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 var numberOfTrackTests = 3; | 12 var numberOfTrackTests = 3; |
11 | 13 |
12 function trackLoaded() | 14 function trackLoaded() |
13 { | 15 { |
14 numberOfTracksLoaded++; | 16 numberOfTracksLoaded++; |
15 if (numberOfTracksLoaded == numberOfTrackTests) { | 17 if (numberOfTracksLoaded == numberOfTrackTests) { |
16 testTrack(0); | 18 testTrack(0); |
17 testTrack(1); | 19 testTrack(1); |
18 testTrackError(2); | 20 testTrackError(2); |
19 } | 21 } |
20 } | 22 } |
21 | 23 |
22 function testTrack(i) | 24 function testTrack(i) |
23 { | 25 { |
24 findMediaElement(); | 26 findMediaElement(); |
25 var expected = | 27 var expected = |
26 { | 28 { |
27 length : 4, | 29 length : 4, |
28 tests: | 30 tests: |
29 [ | 31 [ |
30 { | 32 { |
31 property : "position", | 33 property : "position", |
32 values : [0, 50, "auto", 100], | 34 values : [0, 50, "auto", 100], |
33 }, | 35 }, |
34 ], | 36 ], |
35 }; | 37 }; |
36 testCues(i, expected); | 38 testCues(i, expected); |
37 | 39 |
38 allTestsEnded(); | 40 allTestsEnded(); |
39 } | 41 } |
40 | 42 |
41 function testTrackError(i) | 43 function testTrackError(i) |
42 { | 44 { |
43 findMediaElement(); | 45 findMediaElement(); |
44 var expected = | 46 var expected = |
45 { | 47 { |
46 length : 8, | 48 length : 8, |
47 tests: | 49 tests: |
48 [ | 50 [ |
49 { | 51 { |
50 property : "position", | 52 property : "position", |
51 values : ["auto", "auto", "auto", "auto", "auto", "a
uto", "auto", "auto"], | 53 values : ["auto", "auto", "auto", "auto", "auto", "a
uto", "auto", "auto"], |
52 }, | 54 }, |
53 ], | 55 ], |
54 }; | 56 }; |
55 testCues(i, expected); | 57 testCues(i, expected); |
56 | 58 |
57 allTestsEnded(); | 59 allTestsEnded(); |
58 } | 60 } |
59 </script> | 61 </script> |
60 </head> | 62 </head> |
61 <body onload="enableAllTextTracks()"> | 63 <body onload="enableAllTextTracks()"> |
62 <p>Tests cue text position from settings.</p> | 64 <p>Tests cue text position from settings.</p> |
63 <video> | 65 <video> |
64 <track src="captions-webvtt/tc015-positioning.vtt" onload="trackLoad
ed()"> | 66 <track src="captions-webvtt/tc015-positioning.vtt" onload="trackLoad
ed()"> |
65 <track src="captions-webvtt/tc015-positioning-ltr.vtt" onload="track
Loaded()"> | 67 <track src="captions-webvtt/tc015-positioning-ltr.vtt" onload="track
Loaded()"> |
66 <track src="captions-webvtt/tc015-positioning-bad.vtt" onload="track
Loaded()"> | 68 <track src="captions-webvtt/tc015-positioning-bad.vtt" onload="track
Loaded()"> |
67 </video> | 69 </video> |
68 </body> | 70 </body> |
69 </html> | 71 </html> |
OLD | NEW |