Title: [100402] trunk/LayoutTests
- Revision
- 100402
- Author
- ann...@chromium.org
- Date
- 2011-11-15 21:33:23 -0800 (Tue, 15 Nov 2011)
Log Message
Make sure both the video and the track are ready to be tested before testing.
https://bugs.webkit.org/show_bug.cgi?id=72269
Reviewed by Eric Carlson.
* media/track/track-cues-cuechange.html:
* media/track/track-cues-enter-exit.html:
* platform/chromium/test_expectations.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (100401 => 100402)
--- trunk/LayoutTests/ChangeLog 2011-11-16 05:12:33 UTC (rev 100401)
+++ trunk/LayoutTests/ChangeLog 2011-11-16 05:33:23 UTC (rev 100402)
@@ -1,3 +1,14 @@
+2011-11-15 Anna Cavender <ann...@chromium.org>
+
+ Make sure both the video and the track are ready to be tested before testing.
+ https://bugs.webkit.org/show_bug.cgi?id=72269
+
+ Reviewed by Eric Carlson.
+
+ * media/track/track-cues-cuechange.html:
+ * media/track/track-cues-enter-exit.html:
+ * platform/chromium/test_expectations.txt:
+
2011-11-15 Tony Chang <t...@chromium.org>
[chromium] fix overlapping expectations
Modified: trunk/LayoutTests/media/track/track-cues-cuechange.html (100401 => 100402)
--- trunk/LayoutTests/media/track/track-cues-cuechange.html 2011-11-16 05:12:33 UTC (rev 100401)
+++ trunk/LayoutTests/media/track/track-cues-cuechange.html 2011-11-16 05:33:23 UTC (rev 100402)
@@ -9,7 +9,7 @@
<body>
<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="" kind="captions">
+ <track id="testTrack" src="" kind="captions" _onload_="loaded()">
</video>
<script>
@@ -17,6 +17,22 @@
var currentCue;
var testTrack;
+ var trackLoaded = false;
+ var videoCanPlayThrough = false;
+
+ function attemptTests()
+ {
+ if (!trackLoaded || !videoCanPlayThrough)
+ return;
+
+ testTrack = document.getElementById("testTrack");
+ testExpected("testTrack.track.cues.length", 3);
+ testTrack.addEventListener('cuechange', cueChangedFromTrackElement);
+ testTrack.track.addEventListener('cuechange', cueChangedFromTextTrack);
+ run("video.play()");
+ consoleWrite("");
+ }
+
function cueChangedFromTrackElement()
{
consoleWrite("EVENT(cuechange) from <track>");
@@ -53,14 +69,16 @@
waitForEvent('canplaythrough',
function ()
{
- testTrack = document.getElementById("testTrack");
- testExpected("testTrack.track.cues.length", 3);
- testTrack.addEventListener('cuechange', cueChangedFromTrackElement);
- testTrack.track.addEventListener('cuechange', cueChangedFromTextTrack);
- run("video.play()");
- consoleWrite("");
+ videoCanPlayThrough = true;
+ attemptTests();
}
);
+
+ function loaded()
+ {
+ trackLoaded = true;
+ attemptTests();
+ }
findMediaElement();
video.src = "" "../content/test");
Modified: trunk/LayoutTests/media/track/track-cues-enter-exit.html (100401 => 100402)
--- trunk/LayoutTests/media/track/track-cues-enter-exit.html 2011-11-16 05:12:33 UTC (rev 100401)
+++ trunk/LayoutTests/media/track/track-cues-enter-exit.html 2011-11-16 05:33:23 UTC (rev 100402)
@@ -9,7 +9,7 @@
<body>
<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="" kind="captions">
+ <track id="testTrack" src="" kind="captions" _onload_="loaded()">
</video>
<script>
@@ -17,6 +17,24 @@
var currentCue;
var testTrack;
+ var trackLoaded = false;
+ var videoCanPlayThrough = false;
+
+ function attemptTests()
+ {
+ if (!trackLoaded || !videoCanPlayThrough)
+ return;
+
+ testTrack = document.getElementById("testTrack");
+ testExpected("testTrack.track.cues.length", 3);
+ for (var i = 0; i < testTrack.track.cues.length; i++) {
+ testTrack.track.cues[i].addEventListener('enter', cueEntered);
+ testTrack.track.cues[i].addEventListener('exit', cueExited);
+ }
+ run("video.play()");
+ consoleWrite("");
+ }
+
function cueEntered()
{
consoleWrite("EVENT(enter)");
@@ -42,16 +60,16 @@
waitForEvent('canplaythrough',
function ()
{
- testTrack = document.getElementById("testTrack");
- testExpected("testTrack.track.cues.length", 3);
- for (var i = 0; i < testTrack.track.cues.length; i++) {
- testTrack.track.cues[i].addEventListener('enter', cueEntered);
- testTrack.track.cues[i].addEventListener('exit', cueExited);
- }
- run("video.play()");
- consoleWrite("");
+ videoCanPlayThrough = true;
+ attemptTests();
}
);
+
+ function loaded()
+ {
+ trackLoaded = true;
+ attemptTests();
+ }
findMediaElement();
video.src = "" "../content/test");
Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (100401 => 100402)
--- trunk/LayoutTests/platform/chromium/test_expectations.txt 2011-11-16 05:12:33 UTC (rev 100401)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt 2011-11-16 05:33:23 UTC (rev 100402)
@@ -3934,6 +3934,4 @@
BUGWK72434 : inspector/styles/svg-style.xhtml = TEXT PASS
-BUGWK72269 : media/track/track-cues-cuechange.html = TEXT PASS
-
-BUGWK72447 : inspector/extensions/extensions-events.html = TEXT PASS
+BUGWK72447 : inspector/extensions/extensions-events.html = TEXT PASS
\ No newline at end of file
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes