OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Tests cue text position and alignment from settings.</title> | 2 <title>Tests cue text position and alignment from settings.</title> |
3 <script src="track-helpers.js"></script> | 3 <script src="track-helpers.js"></script> |
4 <script src="../../resources/testharness.js"></script> | 4 <script src="../../resources/testharness.js"></script> |
5 <script src="../../resources/testharnessreport.js"></script> | 5 <script src="../../resources/testharnessreport.js"></script> |
6 <video> | 6 <video> |
7 <track src="captions-webvtt/tc016-align-positioning.vtt"> | 7 <track src="captions-webvtt/tc016-align-positioning.vtt"> |
8 <track src="captions-webvtt/tc016-align-positioning-bad.vtt"> | 8 <track src="captions-webvtt/tc016-align-positioning-bad.vtt"> |
9 </video> | 9 </video> |
10 <script> | 10 <script> |
(...skipping 14 matching lines...) Expand all Loading... |
25 return; | 25 return; |
26 | 26 |
27 testTrack(0); | 27 testTrack(0); |
28 testTrackError(1); | 28 testTrackError(1); |
29 t.done(); | 29 t.done(); |
30 } | 30 } |
31 | 31 |
32 function testTrack(index) { | 32 function testTrack(index) { |
33 var expected = [ | 33 var expected = [ |
34 { position : 10, align : "start" }, | 34 { position : 10, align : "start" }, |
35 { position : 20, align : "middle" }, | 35 { position : 20, align : "center" }, |
36 { position : 80, align : "end" } | 36 { position : 80, align : "end" } |
37 ]; | 37 ]; |
38 | 38 |
39 assert_cues_match(video.textTracks[index].cues, expected); | 39 assert_cues_match(video.textTracks[index].cues, expected); |
40 } | 40 } |
41 | 41 |
42 function testTrackError(index) { | 42 function testTrackError(index) { |
43 var expected = [ | 43 var expected = [ |
44 { position : 10, align : "middle" }, | 44 { position : 10, align : "center" }, |
45 { position : "auto", align : "middle" }, | 45 { position : "auto", align : "center" }, |
46 { position : "auto", align : "middle" } | 46 { position : "auto", align : "center" } |
47 ]; | 47 ]; |
48 | 48 |
49 assert_cues_match(video.textTracks[index].cues, expected); | 49 assert_cues_match(video.textTracks[index].cues, expected); |
50 } | 50 } |
51 }); | 51 }); |
52 </script> | 52 </script> |
OLD | NEW |