OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Tests cue size and alignment from settings.</title> |
3 <head> | 3 <script src="track-helpers.js"></script> |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 <script> |
| 7 check_cues_from_track("captions-webvtt/tc020-cue-size-align.vtt", function(track
) { |
| 8 var expected = [ |
| 9 { size: 100, align: "start" }, |
| 10 { size: 10, align: "end" }, |
| 11 { size: 0, align: "middle" } |
| 12 ]; |
5 | 13 |
6 <script src=../media-file.js></script> | 14 assert_cues_match(track.cues, expected); |
7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 15 }); |
8 (Please avoid writing new tests using video-test.js) --> | |
9 <script src=../video-test.js></script> | |
10 <script> | |
11 | 16 |
12 var numberOfTrackTests = 2; | 17 check_cues_from_track("captions-webvtt/tc020-cue-size-align-bad.vtt", function(t
rack) { |
| 18 var expected = [ |
| 19 { size: 100, align: "middle" }, |
| 20 { size: 100, align: "end" }, |
| 21 { size: 100, align: "middle" } |
| 22 ]; |
13 | 23 |
14 function trackLoaded() | 24 assert_cues_match(track.cues, expected); |
15 { | 25 }); |
16 numberOfTracksLoaded++; | 26 </script> |
17 if (numberOfTracksLoaded == numberOfTrackTests) { | |
18 testTrack(0); | |
19 testTrackError(1); | |
20 } | |
21 } | |
22 | |
23 function testTrack(i) | |
24 { | |
25 findMediaElement(); | |
26 var expected = | |
27 { | |
28 length : 3, | |
29 tests: | |
30 [ | |
31 { | |
32 property : "size", | |
33 values : [100, 10, 0], | |
34 }, | |
35 { | |
36 property : "align", | |
37 values : ["start", "end", "middle"], | |
38 }, | |
39 ], | |
40 }; | |
41 testCues(i, expected); | |
42 | |
43 allTestsEnded(); | |
44 } | |
45 | |
46 function testTrackError(i) | |
47 { | |
48 findMediaElement(); | |
49 var expected = | |
50 { | |
51 length : 3, | |
52 tests: | |
53 [ | |
54 { | |
55 property : "size", | |
56 values : [100, 100, 100], | |
57 }, | |
58 { | |
59 property : "align", | |
60 values : ["middle", "end", "middle"], | |
61 }, | |
62 ], | |
63 }; | |
64 testCues(i, expected); | |
65 | |
66 allTestsEnded(); | |
67 } | |
68 </script> | |
69 </head> | |
70 <body onload="enableAllTextTracks()"> | |
71 <p>Tests cue size and alignment from settings.</p> | |
72 <video> | |
73 <track src="captions-webvtt/tc020-cue-size-align.vtt" onload="trackL
oaded()"> | |
74 <track src="captions-webvtt/tc020-cue-size-align-bad.vtt" onload="tr
ackLoaded()"> | |
75 </video> | |
76 </body> | |
77 </html> | |
OLD | NEW |