Commit 71c4fc48 authored by annacc@chromium.org's avatar annacc@chromium.org

Change layout tests for cuechange, enter, and exit events to check the order

rather than the timing of the events (since actual timing can not be guaranteed).
https://bugs.webkit.org/show_bug.cgi?id=72269

Reviewed by Tony Gentilcore.

* media/track/track-cues-cuechange-expected.txt:
* media/track/track-cues-cuechange.html:
* media/track/track-cues-enter-exit-expected.txt:
* media/track/track-cues-enter-exit.html:
* platform/chromium/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f6420695
2011-11-15 Anna Cavender <annacc@chromium.org>
Change layout tests for cuechange, enter, and exit events to check the order
rather than the timing of the events (since actual timing can not be guaranteed).
https://bugs.webkit.org/show_bug.cgi?id=72269
Reviewed by Tony Gentilcore.
* media/track/track-cues-cuechange-expected.txt:
* media/track/track-cues-cuechange.html:
* media/track/track-cues-enter-exit-expected.txt:
* media/track/track-cues-enter-exit.html:
* platform/chromium/test_expectations.txt:
2011-11-15 Tony Chang <tony@chromium.org>
enable new flexbox tests everywhere
Tests that TextTrack's cues are indexed and updated within 500ms during video playback. Test uses the cuechange event.
This test may fail occasionally since we cannot guarantee that cue events will fire within 250ms of their startTime or endTime.
Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the cuechange event.
EVENT(canplaythrough)
EXPECTED (testTrack.track.cues.length == '3') OK
RUN(video.play())
EVENT(cuechange) from TextTrack
Cue entered
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '1') OK
EXPECTED (video.currentTime < '1.5') OK
EXPECTED (currentCue.id == '1') OK
EVENT(cuechange) from <track>
Cue entered
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '1') OK
EXPECTED (video.currentTime < '1.5') OK
EXPECTED (currentCue.id == '1') OK
EVENT(cuechange) from TextTrack
End time:
EXPECTED (video.currentTime >= '2') OK
EXPECTED (video.currentTime < '2.5') OK
Cue exited
EVENT(cuechange) from <track>
End time:
EXPECTED (video.currentTime >= '2') OK
EXPECTED (video.currentTime < '2.5') OK
Cue exited
EVENT(cuechange) from TextTrack
Cue entered
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '2.5') OK
EXPECTED (video.currentTime < '3') OK
EXPECTED (currentCue.id == '2') OK
EVENT(cuechange) from <track>
Cue entered
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '2.5') OK
EXPECTED (video.currentTime < '3') OK
EXPECTED (currentCue.id == '2') OK
EVENT(cuechange) from TextTrack
End time:
EXPECTED (video.currentTime >= '3.5') OK
EXPECTED (video.currentTime < '4') OK
Cue exited
EVENT(cuechange) from <track>
End time:
EXPECTED (video.currentTime >= '3.5') OK
EXPECTED (video.currentTime < '4') OK
Cue exited
EVENT(cuechange) from TextTrack
Cue entered
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '4') OK
EXPECTED (video.currentTime < '4.5') OK
EXPECTED (currentCue.id == '3') OK
EVENT(cuechange) from <track>
Cue entered
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '4') OK
EXPECTED (video.currentTime < '4.5') OK
EXPECTED (currentCue.id == '3') OK
EVENT(cuechange) from TextTrack
End time:
EXPECTED (video.currentTime >= '5') OK
EXPECTED (video.currentTime < '5.5') OK
Cue exited
EVENT(cuechange) from <track>
End time:
EXPECTED (video.currentTime >= '5') OK
EXPECTED (video.currentTime < '5.5') OK
Cue exited
END OF TEST
......@@ -7,20 +7,22 @@
<script src=../video-test.js></script>
</head>
<body>
<p>Tests that TextTrack's cues are indexed and updated within 500ms during video playback. Test uses the cuechange event.</p>
<p>This test may fail occasionally since we cannot guarantee that cue events will fire within 250ms of their startTime or endTime.</p>
<p>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the cuechange event.</p>
<video controls>
<track id="testTrack" src="captions-webvtt/cues-chrono-order.vtt" kind="captions">
</video>
<script>
var timeInterval = 0.5;
var cueChangeCount = 0;
var currentCue;
var testTrack;
function cueChangedFromTrackElement()
{
consoleWrite("EVENT(cuechange) from &lt;track&gt;");
currentCueIndex = Math.floor(cueChangeCount/2);
currentCue = event.target.track.cues[currentCueIndex];
checkCue();
++cueChangeCount;
......@@ -31,25 +33,20 @@
function cueChangedFromTextTrack()
{
consoleWrite("EVENT(cuechange) from TextTrack");
currentCueIndex = Math.floor(cueChangeCount/2);
currentCue = event.target.cues[currentCueIndex];
checkCue();
}
function checkCue()
{
var cues = testTrack.track.cues;
var currentCue = cues[Math.floor(cueChangeCount/2)];
if (cueChangeCount % 2 == 0) {
consoleWrite("Cue entered");
testExpected(currentCue, testTrack.track.activeCues[0]);
consoleWrite("Start time:");
testExpected("video.currentTime", currentCue.startTime, '>=');
testExpected("video.currentTime", currentCue.startTime + timeInterval, '<');
} else {
consoleWrite("End time:");
testExpected("video.currentTime", currentCue.endTime, '>=');
testExpected("video.currentTime", currentCue.endTime + timeInterval, '<');
}
testExpected("currentCue.id", currentCueIndex + 1);
} else
consoleWrite("Cue exited");
consoleWrite("");
}
......
Tests that TextTrack's cues are indexed and updated within 500ms during video playback. Test uses the enter and exits events on TextTrackCue.
This test may fail occasionally since we cannot guarantee that cue events will fire within 250ms of their startTime or endTime.
Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the enter and exits events on TextTrackCue.
EVENT(canplaythrough)
EXPECTED (testTrack.track.cues.length == '3') OK
......@@ -9,38 +7,23 @@ RUN(video.play())
EVENT(enter)
This cue is the currently active cue:
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '1') OK
EXPECTED (video.currentTime < '1.5') OK
EXPECTED (currentCue.id == '1') OK
EVENT(exit)
End time:
EXPECTED (video.currentTime >= '2') OK
EXPECTED (video.currentTime < '2.5') OK
EVENT(enter)
This cue is the currently active cue:
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '2.5') OK
EXPECTED (video.currentTime < '3') OK
EXPECTED (currentCue.id == '2') OK
EVENT(exit)
End time:
EXPECTED (video.currentTime >= '3.5') OK
EXPECTED (video.currentTime < '4') OK
EVENT(enter)
This cue is the currently active cue:
EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
Start time:
EXPECTED (video.currentTime >= '4') OK
EXPECTED (video.currentTime < '4.5') OK
EXPECTED (currentCue.id == '3') OK
EVENT(exit)
End time:
EXPECTED (video.currentTime >= '5') OK
EXPECTED (video.currentTime < '5.5') OK
END OF TEST
......@@ -7,40 +7,31 @@
<script src=../video-test.js></script>
</head>
<body>
<p>Tests that TextTrack's cues are indexed and updated within 500ms during video playback. Test uses the enter and exits events on TextTrackCue.</p>
<p>This test may fail occasionally since we cannot guarantee that cue events will fire within 250ms of their startTime or endTime.</p>
<p>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the enter and exits events on TextTrackCue.</p>
<video controls>
<track id="testTrack" src="captions-webvtt/cues-chrono-order.vtt" kind="captions">
</video>
<script>
var timeInterval = 0.5
var cueCount = 0;
var currentCue;
var testTrack;
function cueEntered()
{
consoleWrite("EVENT(enter)");
var currentCue = testTrack.track.cues[cueCount];
currentCue = event.target;
consoleWrite("This cue is the currently active cue:");
testExpected(currentCue, testTrack.track.activeCues[0]);
consoleWrite("Start time:");
testExpected("video.currentTime", currentCue.startTime, '>=');
testExpected("video.currentTime", currentCue.startTime + timeInterval, '<');
testExpected("currentCue.id", cueCount + 1);
consoleWrite("");
}
function cueExited()
{
consoleWrite("EVENT(exit)");
var currentCue = testTrack.track.cues[cueCount];
consoleWrite("End time:");
testExpected("video.currentTime", currentCue.endTime, '>=');
testExpected("video.currentTime", currentCue.endTime + timeInterval, '<');
consoleWrite("");
++cueCount;
......
......@@ -3879,7 +3879,6 @@ BUG_TONY WIN MAC : css3/flexbox/repaint.html = PASS FAIL
BUG_TONY WIN MAC : css3/flexbox/repaint-rtl-column.html = PASS FAIL
BUGWK72149 : media/track/tracklist-is-reachable.html = TEXT
BUGWK72269 : media/track/track-cues-cuechange.html = PASS TEXT
BUGV8_1821 WIN LINUX : http/tests/inspector-enabled/dedicated-workers-list.html = PASS CRASH
BUGWK72133 SKIP MAC : http/tests/inspector-enabled/dedicated-workers-list.html = PASS CRASH TIMEOUT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment