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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc031-cue-recovery.html

Issue 2035753002: Convert track-webvtt-tc[030-032] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Tests that a cue is recovered when a line with a "-->" is encountered (mi ssing blank line separator).</title>
3 <head> 3 <script src="track-helpers.js"></script>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script>
7 check_cues_from_track("captions-webvtt/tc031-cue-recovery-header.vtt", testTrack );
8 check_cues_from_track("captions-webvtt/tc031-cue-recovery-note.vtt", testTrack);
9 check_cues_from_track("captions-webvtt/tc031-cue-recovery-cuetext.vtt", testTrac k);
5 10
6 <script src=../media-file.js></script> 11 function testTrack(track) {
7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 12 var expected = [
8 (Please avoid writing new tests using video-test.js) --> 13 { startTime: 0, endTime: 1, text: "Valid cue 1" },
9 <script src=../video-test.js></script> 14 { startTime: 2, endTime: 3, text: "Valid cue 2" }
10 <script> 15 ];
11 16
12 numberOfTrackTests = 3; 17 assert_cues_match(track.cues, expected);
13 18 }
14 function trackLoaded() 19 </script>
15 {
16 numberOfTracksLoaded++;
17 if (numberOfTracksLoaded == numberOfTrackTests) {
18 testTrack(0);
19 testTrack(1);
20 testTrack(2);
21 }
22 }
23
24 function testTrack(i)
25 {
26 findMediaElement();
27 var expected =
28 {
29 length: 2,
30 tests:
31 [
32 {
33 property: "startTime",
34 values: [ "0", "2" ],
35 },
36 {
37 property: "endTime",
38 values: [ "1", "3" ],
39 },
40 {
41 property: "text",
42 values:
43 [
44 'Valid cue 1',
45 'Valid cue 2',
46 ],
47 },
48 ],
49 };
50
51 testCues(i, expected);
52
53 allTestsEnded();
54 }
55 </script>
56 </head>
57 <body onload="enableAllTextTracks()">
58 <p>Tests that a cue is recovered when a line with a "-->" is encountered ( missing blank line separator).</p>
59 <video>
60 <track src="captions-webvtt/tc031-cue-recovery-header.vtt" onload="t rackLoaded()">
61 <track src="captions-webvtt/tc031-cue-recovery-note.vtt" onload="tra ckLoaded()">
62 <track src="captions-webvtt/tc031-cue-recovery-cuetext.vtt" onload=" trackLoaded()">
63 </video>
64 </body>
65 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698