settings-position.test (2133B)
1 settings, position 2 <link rel="help" href="https://w3c.github.io/webvtt/#collect-webvtt-cue-timings-and-settings"> 3 4 assert_equals(cues.length, 22); 5 6 var valid_positions = [ 7 [1, 'auto'], 8 [100, 'auto'], 9 [1, 'auto'], 10 [1.5, 'auto'], 11 [1, 'line-left'], 12 [1, 'center'], 13 [1, 'line-right'], 14 [1, 'auto'], 15 ]; 16 valid_positions.forEach(function(pair, index) { 17 var position = pair[0]; 18 var positionAlign = pair[1]; 19 20 assert_equals(cues[index].position, position, 'Failed with cue ' + index); 21 assert_equals(cues[index].positionAlign, positionAlign, 'Failed with cue ' + index); 22 }); 23 24 for (var i = 0; i < 14; i++) { 25 var index = valid_positions.length + i; 26 27 assert_equals(cues[index].position, 'auto', 'Failed with cue ' + index); 28 assert_equals(cues[index].positionAlign, 'auto', 'Failed with cue ' + index); 29 } 30 31 === 32 WEBVTT 33 34 NOTE valid 35 36 00:00:00.000 --> 00:00:01.000 position:1% 37 text0 38 39 00:00:00.000 --> 00:00:01.000 position:100% 40 text1 41 42 00:00:00.000 --> 00:00:01.000 position:1% position:x 43 text2 44 45 00:00:00.000 --> 00:00:01.000 position:1.5% 46 text3 47 48 00:00:00.000 --> 00:00:01.000 position:1%,line-left 49 text4 50 51 00:00:00.000 --> 00:00:01.000 position:1%,center 52 text5 53 54 00:00:00.000 --> 00:00:01.000 position:1%,line-right 55 text6 56 57 00:00:00.000 --> 00:00:01.000 position:1% ,center 58 text7 59 60 NOTE invalid 61 62 00:00:00.000 --> 00:00:01.000 position:1%,middle 63 invalid8 64 65 00:00:00.000 --> 00:00:01.000 position:1%, center 66 invalid9 67 68 00:00:00.000 --> 00:00:01.000 position:-1% 69 invalid10 70 71 00:00:00.000 --> 00:00:01.000 position:1 72 invalid11 73 74 00:00:00.000 --> 00:00:01.000 position:1x 75 invalid12 76 77 00:00:00.000 --> 00:00:01.000 position:1%x 78 invalid13 79 80 00:00:00.000 --> 00:00:01.000 position: 81 invalid14 82 83 00:00:00.000 --> 00:00:01.000 position: 1% 84 invalid15 85 86 00:00:00.000 --> 00:00:01.000 position:101% 87 invalid16 88 89 00:00:00.000 --> 00:00:01.000 position:65536% 90 invalid17 91 92 00:00:00.000 --> 00:00:01.000 position:4294967296% 93 invalid18 94 95 00:00:00.000 --> 00:00:01.000 position:101%,line-left 96 invalid19 97 98 00:00:00.000 --> 00:00:01.000 position:101%,center 99 invalid20 100 101 00:00:00.000 --> 00:00:01.000 position:101%,line-right 102 invalid21