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 = 2; | 12 var 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 testTrack(0); | 18 testTrack(0); |
17 testTrackError(1); | 19 testTrackError(1); |
18 } | 20 } |
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 : 5, | 29 length : 5, |
28 tests: | 30 tests: |
29 [ | 31 [ |
30 { | 32 { |
31 property : "align", | 33 property : "align", |
32 values : ["start", "start", "middle", "end", "middle
"], | 34 values : ["start", "start", "middle", "end", "middle
"], |
33 }, | 35 }, |
34 { | 36 { |
35 property : "position", | 37 property : "position", |
36 values : [10, "auto", 80, 30, 60], | 38 values : [10, "auto", 80, 30, 60], |
37 }, | 39 }, |
38 { | 40 { |
39 property : "line", | 41 property : "line", |
40 values : [0, 0, 80, 5, -3], | 42 values : [0, 0, 80, 5, -3], |
41 }, | 43 }, |
42 { | 44 { |
43 property : "snapToLines", | 45 property : "snapToLines", |
44 values : [false, true, false, true, true], | 46 values : [false, true, false, true, true], |
45 }, | 47 }, |
46 ], | 48 ], |
47 }; | 49 }; |
48 testCues(i, expected); | 50 testCues(i, expected); |
49 | 51 |
50 allTestsEnded(); | 52 allTestsEnded(); |
51 } | 53 } |
52 | 54 |
53 function testTrackError(i) | 55 function testTrackError(i) |
54 { | 56 { |
55 findMediaElement(); | 57 findMediaElement(); |
56 var expected = | 58 var expected = |
57 { | 59 { |
58 length : 3, | 60 length : 3, |
59 tests: | 61 tests: |
60 [ | 62 [ |
61 { | 63 { |
62 property : "align", | 64 property : "align", |
63 values : ["middle", "end", "middle"], | 65 values : ["middle", "end", "middle"], |
64 }, | 66 }, |
65 { | 67 { |
66 property : "position", | 68 property : "position", |
67 values : ["auto", 0, 60], | 69 values : ["auto", 0, 60], |
68 }, | 70 }, |
69 { | 71 { |
70 property : "line", | 72 property : "line", |
71 values : ["auto", "auto", -3], | 73 values : ["auto", "auto", -3], |
72 }, | 74 }, |
73 { | 75 { |
74 property : "snapToLines", | 76 property : "snapToLines", |
75 values : [true, true, true], | 77 values : [true, true, true], |
76 }, | 78 }, |
77 ], | 79 ], |
78 }; | 80 }; |
79 testCues(i, expected); | 81 testCues(i, expected); |
80 | 82 |
81 allTestsEnded(); | 83 allTestsEnded(); |
82 } | 84 } |
83 </script> | 85 </script> |
84 </head> | 86 </head> |
85 <body onload="enableAllTextTracks()"> | 87 <body onload="enableAllTextTracks()"> |
86 <p>Tests cue alignment, line and text position from settings.</p> | 88 <p>Tests cue alignment, line and text position from settings.</p> |
87 <video> | 89 <video> |
88 <track src="captions-webvtt/tc018-align-text-line-position.vtt" onlo
ad="trackLoaded()"> | 90 <track src="captions-webvtt/tc018-align-text-line-position.vtt" onlo
ad="trackLoaded()"> |
89 <track src="captions-webvtt/tc018-align-text-line-position-bad.vtt"
onload="trackLoaded()"> | 91 <track src="captions-webvtt/tc018-align-text-line-position-bad.vtt"
onload="trackLoaded()"> |
90 </video> | 92 </video> |
91 </body> | 93 </body> |
92 </html> | 94 </html> |
OLD | NEW |