Commit ea0b0036 authored by annacc@chromium.org's avatar annacc@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=72399

Reviewed by Eric Carlson.

* media/track/track-cues-seeking.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8b858c7c
2011-11-15 Anna Cavender <annacc@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=72399
Reviewed by Eric Carlson.
* media/track/track-cues-seeking.html:
2011-11-15 Tony Chang <tony@chromium.org>
Land chromium win results for flexbox repaint tests.
......@@ -9,12 +9,26 @@
<body>
<p>Tests TextTrack's activeCues are indexed and updated during video playback.</p>
<video controls>
<track id="testTrack" src="captions-webvtt/cues-overlapping.vtt" kind="subtitles">
<track id="testTrack" src="captions-webvtt/cues-overlapping.vtt" kind="subtitles" onload="loaded()">
</video>
<script>
var seekedCount = 0;
var testTrack;
var trackLoaded = false;
var videoCanPlayThrough = false;
function attemptTests()
{
if (!trackLoaded || !videoCanPlayThrough)
return;
testTrack = document.getElementById("testTrack");
testExpected("testTrack.track.cues.length", 3);
run("video.currentTime = 0.5");
consoleWrite("");
}
function seeked()
{
......@@ -38,12 +52,16 @@
waitForEvent('canplaythrough',
function ()
{
testTrack = document.getElementById("testTrack");
testExpected("testTrack.track.cues.length", 3);
run("video.currentTime = 0.5");
consoleWrite("");
videoCanPlayThrough = true;
attemptTests();
}
);
function loaded()
{
trackLoaded = true;
attemptTests();
}
findMediaElement();
video.src = findMediaFile("video", "../content/test");
......
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