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 | 23 |
22 function testTrack0() | 24 function testTrack0() |
23 { | 25 { |
24 findMediaElement(); | 26 findMediaElement(); |
25 var expected = | 27 var expected = |
26 { | 28 { |
27 length : 3, | 29 length : 3, |
28 tests: | 30 tests: |
29 [ | 31 [ |
30 { | 32 { |
31 property : "id", | 33 property : "id", |
32 values : ["", "", ""], | 34 values : ["", "", ""], |
33 }, | 35 }, |
34 { | 36 { |
35 property : "startTime", | 37 property : "startTime", |
(...skipping 10 matching lines...) Expand all Loading... |
46 ], | 48 ], |
47 }; | 49 }; |
48 testCues(0, expected); | 50 testCues(0, expected); |
49 | 51 |
50 allTestsEnded(); | 52 allTestsEnded(); |
51 } | 53 } |
52 | 54 |
53 function testTrack1() | 55 function testTrack1() |
54 { | 56 { |
55 findMediaElement(); | 57 findMediaElement(); |
56 var expected = | 58 var expected = |
57 { | 59 { |
58 length : 0, | 60 length : 0, |
59 tests: | 61 tests: |
60 [], | 62 [], |
61 }; | 63 }; |
62 testCues(1, expected); | 64 testCues(1, expected); |
63 | 65 |
64 allTestsEnded(); | 66 allTestsEnded(); |
65 } | 67 } |
66 </script> | 68 </script> |
67 </head> | 69 </head> |
68 <body onload="enableAllTextTracks()"> | 70 <body onload="enableAllTextTracks()"> |
69 <p>Tests empty cue identifiers (they are optional), but makes sure "-->"
found leads to discarded cue.</p> | 71 <p>Tests empty cue identifiers (they are optional), but makes sure "-->"
found leads to discarded cue.</p> |
70 <video> | 72 <video> |
71 <track src="captions-webvtt/tc007-cue-no-id.vtt" onload="trackLoaded
()"> | 73 <track src="captions-webvtt/tc007-cue-no-id.vtt" onload="trackLoaded
()"> |
72 <track src="captions-webvtt/tc007-cue-no-id-error.vtt" onload="track
Loaded()"> | 74 <track src="captions-webvtt/tc007-cue-no-id-error.vtt" onload="track
Loaded()"> |
73 </video> | 75 </video> |
74 </body> | 76 </body> |
75 </html> | 77 </html> |
OLD | NEW |