OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Tests cue alignment from settings.</title> | 2 <title>Tests cue 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 <script> | 6 <script> |
7 check_cues_from_track("captions-webvtt/tc014-alignment.vtt", testTrack); | 7 check_cues_from_track("captions-webvtt/tc014-alignment.vtt", testTrack); |
8 check_cues_from_track("captions-webvtt/tc014-alignment-ltr.vtt", testTrack); | 8 check_cues_from_track("captions-webvtt/tc014-alignment-ltr.vtt", testTrack); |
9 | 9 |
10 check_cues_from_track("captions-webvtt/tc014-alignment-bad.vtt", function(track)
{ | 10 check_cues_from_track("captions-webvtt/tc014-alignment-bad.vtt", function(track)
{ |
11 var expected = [ | 11 var expected = [ |
12 { align: "middle" }, | 12 { align: "center" }, |
13 { align: "middle" }, | 13 { align: "center" }, |
14 { align: "middle" }, | 14 { align: "center" }, |
15 { align: "middle" } | 15 { align: "center" } |
16 ]; | 16 ]; |
17 | 17 |
18 assert_cues_match(track.cues, expected); | 18 assert_cues_match(track.cues, expected); |
19 }); | 19 }); |
20 | 20 |
21 function testTrack(track) { | 21 function testTrack(track) { |
22 var expected = [ | 22 var expected = [ |
23 { align: "start" }, | 23 { align: "start" }, |
24 { align: "middle" }, | 24 { align: "center" }, |
25 { align: "end" }, | 25 { align: "end" }, |
26 { align: "middle" } | 26 { align: "center" } |
27 ]; | 27 ]; |
28 | 28 |
29 assert_cues_match(track.cues, expected); | 29 assert_cues_match(track.cues, expected); |
30 } | 30 } |
31 </script> | 31 </script> |
OLD | NEW |