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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <title>Tests that any text other than "-->" is recognized as optional cue identi fier.</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/tc006-cue-id.vtt", function(track) {
8 var expected = [
9 { id: "random_id", startTime: 0, endTime: 30.5, text: "Bear is Coming!!! !!" },
10 { id: "another random identifier", startTime: 31, endTime: 60.5, text: " I said Bear is coming!!!!" },
11 { id: "identifier--too", startTime: 61, endTime: 120.5, text: "I said Be ar is coming now!!!!" },
12 { id: "identifier--too", startTime: 121, endTime: 180.5, text: "Duplicat e identifier" }
13 ];
5 14
6 <script src=../media-file.js></script> 15 assert_cues_match(track.cues, expected);
7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 16 });
8 (Please avoid writing new tests using video-test.js) -->
9 <script src=../video-test.js></script>
10 <script>
11 17
12 numberOfTrackTests = 2; 18 check_cues_from_track("captions-webvtt/tc006-cue-id-error.vtt", function(track) {
19 var expected = [
20 { id: "", startTime: 0, endTime: 30.5, text: "Bear is Coming!!!!!" },
21 { id: "", startTime: 31, endTime: 60.5, text: "I said Bear is coming!!!! " },
22 { id: "", startTime: 61, endTime: 1200.5, text: "I said Bear is coming n ow!!!!" }
23 ];
13 24
14 function trackLoaded() 25 assert_cues_match(track.cues, expected);
15 { 26 });
16 numberOfTracksLoaded++; 27 </script>
17 if (numberOfTracksLoaded == numberOfTrackTests) {
18 testTrack0();
19 testTrack1();
20 }
21 }
22
23 function testTrack0()
24 {
25 findMediaElement();
26
27 var expected =
28 {
29 length : 4,
30 tests:
31 [
32 {
33 property : "id",
34 values : ["random_id", "another random identifier", "identifier--too", "identifier--too"],
35 },
36 {
37 property : "startTime",
38 values : [0.0, 31.0, 61.0, 121.0],
39 },
40 {
41 property : "endTime",
42 values : [30.5, 60.5, 120.5, 180.5],
43 },
44 {
45 property : "text",
46 values : ["Bear is Coming!!!!!", "I said Bear is com ing!!!!", "I said Bear is coming now!!!!", "Duplicate identifier"],
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 that any text other than "-->" is recognized as optional cue id entifier.</p>
72 <video>
73 <track src="captions-webvtt/tc006-cue-id.vtt" onload="trackLoaded()" >
74 <track src="captions-webvtt/tc006-cue-id-error.vtt" onload="trackLoa ded()">
75 </video>
76 </body>
77 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-webvtt-tc006-cue-identifiers-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698