OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
5 | 5 |
6 <script src=../media-file.js></script> | 6 <script src=../media-file.js></script> |
| 7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 8 (Please avoid writing new tests using video-test.js) --> |
7 <script src=../video-test.js></script> | 9 <script src=../video-test.js></script> |
8 <script> | 10 <script> |
9 | 11 |
10 numberOfTrackTests = 2; | 12 numberOfTrackTests = 2; |
11 | 13 |
12 function trackLoaded() | 14 function trackLoaded() |
13 { | 15 { |
14 numberOfTracksLoaded++; | 16 numberOfTracksLoaded++; |
15 if (numberOfTracksLoaded == numberOfTrackTests) { | 17 if (numberOfTracksLoaded == numberOfTrackTests) { |
16 testTrack0(); | 18 testTrack0(); |
17 testTrack1(); | 19 testTrack1(); |
18 } | 20 } |
19 } | 21 } |
20 | 22 |
21 function testTrack0() | 23 function testTrack0() |
22 { | 24 { |
23 findMediaElement(); | 25 findMediaElement(); |
24 var expected = | 26 var expected = |
25 { | 27 { |
26 length : 3, | 28 length : 3, |
27 tests: | 29 tests: |
28 [ | 30 [ |
29 { | 31 { |
30 property : "id", | 32 property : "id", |
31 values : ["1", "2", "3"], | 33 values : ["1", "2", "3"], |
32 }, | 34 }, |
33 { | 35 { |
34 property : "startTime", | 36 property : "startTime", |
(...skipping 10 matching lines...) Expand all Loading... |
45 ], | 47 ], |
46 }; | 48 }; |
47 testCues(0, expected); | 49 testCues(0, expected); |
48 | 50 |
49 allTestsEnded(); | 51 allTestsEnded(); |
50 } | 52 } |
51 | 53 |
52 function testTrack1() | 54 function testTrack1() |
53 { | 55 { |
54 findMediaElement(); | 56 findMediaElement(); |
55 var expected = | 57 var expected = |
56 { | 58 { |
57 length : 1, | 59 length : 1, |
58 tests: | 60 tests: |
59 [], | 61 [], |
60 }; | 62 }; |
61 testCues(1, expected); | 63 testCues(1, expected); |
62 | 64 |
63 allTestsEnded(); | 65 allTestsEnded(); |
64 } | 66 } |
65 </script> | 67 </script> |
66 </head> | 68 </head> |
67 <body onload="enableAllTextTracks()"> | 69 <body onload="enableAllTextTracks()"> |
68 <p>Tests that cues are not affected by multiple newlines \n, \r, and \r\n an
d that cue not properly separated are treated as one big cue.</p> | 70 <p>Tests that cues are not affected by multiple newlines \n, \r, and \r\n an
d that cue not properly separated are treated as one big cue.</p> |
69 <video> | 71 <video> |
70 <track src="captions-webvtt/tc011-cues.vtt" onload="trackLoaded()"> | 72 <track src="captions-webvtt/tc011-cues.vtt" onload="trackLoaded()"> |
71 <track src="captions-webvtt/tc011-cues-no-separation.vtt" onload="tr
ackLoaded()"> | 73 <track src="captions-webvtt/tc011-cues-no-separation.vtt" onload="tr
ackLoaded()"> |
72 </video> | 74 </video> |
73 </body> | 75 </body> |
74 </html> | 76 </html> |
OLD | NEW |