Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Tests cue alignment, line and text position from settings.</title> | 2 <title>Tests cue alignment, line and text position 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/tc018-align-text-line-position.vtt"> | 7 <track src="captions-webvtt/tc018-align-text-line-position.vtt"> |
| 8 <track src="captions-webvtt/tc018-align-text-line-position-bad.vtt"> | 8 <track src="captions-webvtt/tc018-align-text-line-position-bad.vtt"> |
| 9 </video> | 9 </video> |
| 10 <script> | 10 <script> |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 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 { align : "start", position : 10, line : 0, snapToLines : fals e }, | 34 { align : "start", position : 10, line : 0, snapToLines : fals e }, |
| 35 { align : "start", position : "auto", line : 0, snapToLines : true }, | 35 { align : "start", position : "auto", line : 0, snapToLines : true }, |
| 36 { align : "middle", position : 80, line : 80, snapToLines : fals e }, | 36 { align : "center", position : 80, line : 80, snapToLines : fals e }, |
| 37 { align : "end", position : 30, line : 5, snapToLines : true }, | 37 { align : "end", position : 30, line : 5, snapToLines : true }, |
| 38 { align : "middle", position : 60, line : -3, snapToLines : true } | 38 { align : "center", position : 60, line : -3, snapToLines : true } |
| 39 ]; | 39 ]; |
| 40 | 40 |
| 41 assert_cues_match(video.textTracks[index].cues, expected); | 41 assert_cues_match(video.textTracks[index].cues, expected); |
| 42 } | 42 } |
| 43 | 43 |
| 44 function testTrackError(index) { | 44 function testTrackError(index) { |
| 45 var expected = [ | 45 var expected = [ |
| 46 { align : "middle", position : "auto", line : "auto", snapToLines : true }, | 46 { align : "genter", position : "auto", line : "auto", snapToLines : true }, |
|
fs
2017/02/15 09:38:50
center
maksims (do not use this acc)
2017/02/16 06:41:09
Done.
| |
| 47 { align : "end", position : 0, line : "auto", snapToLines : true }, | 47 { align : "end", position : 0, line : "auto", snapToLines : true }, |
| 48 { align : "middle", position : 60, line : -3, snapToLines : true } | 48 { align : "center", position : 60, line : -3, snapToLines : true } |
| 49 ]; | 49 ]; |
| 50 | 50 |
| 51 assert_cues_match(video.textTracks[index].cues, expected); | 51 assert_cues_match(video.textTracks[index].cues, expected); |
| 52 } | 52 } |
| 53 }); | 53 }); |
| 54 </script> | 54 </script> |
| OLD | NEW |