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

Side by Side Diff: LayoutTests/media/track/track-in-band-cues-added-once.html

Issue 40513003: Delete/move the remaining stale tests in TestExpectations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: delete plugins/reentrant-update-widget-positions.html as well Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
6 <script src=../media-file.js></script>
7 <script src=../video-test.js></script>
8 <script>
9
10 var addtrackEventCount = 0;
11 var seekedCount = 0;
12 var cuesStarts = [];
13
14 function trackAdded(event)
15 {
16 consoleWrite("EVENT(" + event.type + ")");
17 compareTracks("event.track", "video.textTracks[" + addtrackEvent Count + "]");
18 ++addtrackEventCount;
19 consoleWrite("");
20 }
21
22 function compareTracks(track1, track2)
23 {
24 var equal = (eval(track1) == eval(track2));
25 reportExpected(equal, track1, "==", track2, track1);
26 }
27
28 function pollProgress()
29 {
30 if (video.currentTime < 2)
31 return;
32
33 testExpected("inbandTrack1.cues.length", 0, ">");
34
35 if (!seekedCount) {
36 // Collect the start times of all cues, seek back to the beg inning and play
37 // the same segment of the video file.
38 run("video.pause()");
39 for (var i = 0; i < inbandTrack1.cues.length; ++i)
40 cuesStarts.push(inbandTrack1.cues[i].startTime);
41 run("video.currentTime = 0");
42 run("video.play()");
43 consoleWrite("");
44 return;
45 }
46
47 run("video.pause()");
48 for (var i = 0; i < cuesStarts.length; ++i) {
49 if (cuesStarts[i] != inbandTrack1.cues[i].startTime)
50 logResult(false, "Found unexpected cue starting at " + i nbandTrack1.cues[i].startTime);
51 }
52 endTest();
53 }
54
55 function canplaythrough()
56 {
57 video.textTracks.removeEventListener("addtrack", trackAdded, fal se);
58
59 consoleWrite("<br><i>** Check initial in-band track states<" + " /i>");
60 testExpected("video.textTracks.length", 1);
61 run("inbandTrack1 = video.textTracks[0]");
62 testExpected("inbandTrack1.mode", "disabled");
63 testExpected("inbandTrack1.cues", null);
64 testExpected("inbandTrack1.language", "en");
65 testExpected("inbandTrack1.kind", "captions");
66
67
68 consoleWrite("");
69
70 waitForEvent('seeked', function() { ++seekedCount; });
71 setInterval(pollProgress, 100);
72 run("inbandTrack1.mode = 'showing'");
73 run("video.play()");
74 }
75
76 function setup()
77 {
78 findMediaElement();
79 video.textTracks.addEventListener("addtrack", trackAdded);
80 video.src = '../content/counting-captioned.mov';
81 waitForEvent('canplaythrough', canplaythrough);
82 }
83
84 </script>
85 </head>
86 <body onload="setup()">
87 <video controls></video>
88 <p>In-band text tracks.</p>
89 </body>
90 </html>
OLDNEW
« no previous file with comments | « LayoutTests/media/track/track-in-band.html ('k') | LayoutTests/media/track/track-in-band-cues-added-once-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698