| Index: LayoutTests/media/track/track-disabled-addcue.html
|
| diff --git a/LayoutTests/media/track/track-disabled-addcue.html b/LayoutTests/media/track/track-disabled-addcue.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2737191fb266472baf590fbe6b1de30b6d8e2f95
|
| --- /dev/null
|
| +++ b/LayoutTests/media/track/track-disabled-addcue.html
|
| @@ -0,0 +1,44 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| + <head>
|
| + <script src="../media-file.js"></script>
|
| + <script src="../video-test.js"></script>
|
| + <script>
|
| + function onLoad()
|
| + {
|
| + if (window.testRunner)
|
| + testRunner.dumpAsText();
|
| +
|
| + var cueDuration = 0.1;
|
| + var video = document.querySelector("#vid");
|
| + var track = video.addTextTrack("subtitles");
|
| + track.mode = "disabled";
|
| +
|
| + for (var i = 0; i < 10; ++i) {
|
| + var start = i * cueDuration;
|
| + var end = start + cueDuration;
|
| + track.addCue(new TextTrackCue(start, end, "Test Cue " + i));
|
| + }
|
| +
|
| + consoleWrite("Waiting for 2 cue durations to elapse.");
|
| +
|
| + video.addEventListener('timeupdate', function (e)
|
| + {
|
| + if (e.target.currentTime < 2 * cueDuration)
|
| + return;
|
| +
|
| + // End test after at least 2 cueDurations to make sure the test
|
| + // doesn't crash during the period the first 2 cues would have been
|
| + // rendered if the track was not disabled.
|
| + consoleWrite("2 cue durations have elapsed.");
|
| + endTest();
|
| + });
|
| + video.play();
|
| + }
|
| + </script>
|
| + </head>
|
| + <body onload="onLoad()">
|
| + <p>Test adding cues to a disabled text track. </p>
|
| + <video id="vid" src="../content/test.ogv" controls></video>
|
| + </body>
|
| +</html>
|
|
|