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 : 2, | 28 length : 2, |
27 tests: | 29 tests: |
28 [ | 30 [ |
29 { | 31 { |
30 property : "id", | 32 property : "id", |
31 values : [1, 2], | 33 values : [1, 2], |
32 }, | 34 }, |
33 { | 35 { |
34 property : "startTime", | 36 property : "startTime", |
35 values : [0.0, 31.0], | 37 values : [0.0, 31.0], |
36 }, | 38 }, |
37 { | 39 { |
38 property : "endTime", | 40 property : "endTime", |
39 values : [30.5, 1200.5], | 41 values : [30.5, 1200.5], |
40 }, | 42 }, |
41 { | 43 { |
42 property : "text", | 44 property : "text", |
43 values : ["景気判断", "電力不足"], | 45 values : ["景気判断", "電力不足"], |
44 }, | 46 }, |
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 : 2, | 59 length : 2, |
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 | 67 |
66 </script> | 68 </script> |
67 </head> | 69 </head> |
68 <body onload="enableAllTextTracks()"> | 70 <body onload="enableAllTextTracks()"> |
69 <p>Tests that UTF-8 encoded characters are recognized properly and that
different encodings (iconv) are not recognized as a WebVTT file (we do allow it,
it just looks ugly).</p> | 71 <p>Tests that UTF-8 encoded characters are recognized properly and that
different encodings (iconv) are not recognized as a WebVTT file (we do allow it,
it just looks ugly).</p> |
70 <video> | 72 <video> |
71 <track src="captions-webvtt/tc001-utf8.vtt" onload="trackLoaded()"> | 73 <track src="captions-webvtt/tc001-utf8.vtt" onload="trackLoaded()"> |
72 <track src="captions-webvtt/tc001-iso2022jp3.vtt" onload="trackLoade
d()"> | 74 <track src="captions-webvtt/tc001-iso2022jp3.vtt" onload="trackLoade
d()"> |
73 </video> | 75 </video> |
74 </body> | 76 </body> |
75 </html> | 77 </html> |
OLD | NEW |