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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html

Issue 2042613002: Convert track-webvtt-tc[006,007,011] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit and add more info in the description 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 empty cue identifiers (they are optional), but makes sure "-->" fou nd leads to discarded cue.</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/tc007-cue-no-id.vtt", testTrack);
8 check_cues_from_track("captions-webvtt/tc007-cue-no-id-error.vtt", testTrack);
5 9
6 <script src=../media-file.js></script> 10 function testTrack(track) {
7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 11 var expected = [
8 (Please avoid writing new tests using video-test.js) --> 12 { id: "", startTime: 0, endTime: 30.5, text: "Bear is Coming!!!!!" },
9 <script src=../video-test.js></script> 13 { id: "", startTime: 31, endTime: 60.5, text: "I said Bear is coming!!!! " },
10 <script> 14 { id: "", startTime: 61, endTime: 1200.5, text: "I said Bear is coming n ow!!!!" }
15 ];
11 16
12 numberOfTrackTests = 2; 17 assert_cues_match(track.cues, expected);
13 18 }
14 function trackLoaded() 19 </script>
15 {
16 numberOfTracksLoaded++;
17 if (numberOfTracksLoaded == numberOfTrackTests) {
18 testTrack0();
19 testTrack1();
20 }
21 }
22
23
24 function testTrack0()
25 {
26 findMediaElement();
27 var expected =
28 {
29 length : 3,
30 tests:
31 [
32 {
33 property : "id",
34 values : ["", "", ""],
35 },
36 {
37 property : "startTime",
38 values : [0.0, 31.0, 61.0],
39 },
40 {
41 property : "endTime",
42 values : [30.5, 60.5, 1200.5],
43 },
44 {
45 property : "text",
46 values : ["Bear is Coming!!!!!", "I said Bear is com ing!!!!", "I said Bear is coming now!!!!"],
47 },
48 ],
49 };
50 testCues(0, expected);
51
52 allTestsEnded();
53 }
54
55 function testTrack1()
56 {
57 findMediaElement();
58 var expected =
59 {
60 length : 0,
61 tests:
62 [],
63 };
64 testCues(1, expected);
65
66 allTestsEnded();
67 }
68 </script>
69 </head>
70 <body onload="enableAllTextTracks()">
71 <p>Tests empty cue identifiers (they are optional), but makes sure "-->" found leads to discarded cue.</p>
72 <video>
73 <track src="captions-webvtt/tc007-cue-no-id.vtt" onload="trackLoaded ()">
74 <track src="captions-webvtt/tc007-cue-no-id-error.vtt" onload="track Loaded()">
75 </video>
76 </body>
77 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698