Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: LayoutTests/media/track/track-disabled-addcue.html

Issue 18856005: Fix HTMLMediaElement so that it doesn't add cues for disabled text tracks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>
« no previous file with comments | « LayoutTests/media/track/track-disabled.html ('k') | LayoutTests/media/track/track-disabled-addcue-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698