tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

regions-lines.test (1651B)


      1 regions, lines
      2 <link rel="help" href="https://w3c.github.io/webvtt/#collect-webvtt-region-settings">
      3 
      4 assert_equals(cues.length, 13);
      5 
      6 var regions = Array.from(cues).map(function(cue) {
      7     return cue.region;
      8 });
      9 
     10 var valid_lines = [
     11     0,
     12     1,
     13     100,
     14     101,
     15     65536,
     16     4294967296,
     17     18446744073709552000,
     18     10000000000000000000000000000000000,
     19     2,
     20 ];
     21 valid_lines.forEach(function(valid, index) {
     22     assert_equals(regions[index].lines, valid, 'Failed with region ' + index);
     23 });
     24 
     25 for (var i = 0; i < 4; i++) {
     26     var index = valid_lines.length + i;
     27 
     28     assert_equals(regions[index].lines, 3, 'Failed with region ' + index);
     29 }
     30 
     31 ===
     32 WEBVTT
     33 
     34 NOTE valid
     35 
     36 REGION
     37 id:1
     38 lines:0
     39 
     40 REGION
     41 id:2
     42 lines:1
     43 
     44 REGION
     45 id:3
     46 lines:100
     47 
     48 REGION
     49 id:4
     50 lines:101
     51 
     52 REGION
     53 id:5
     54 lines:65536
     55 
     56 REGION
     57 id:6
     58 lines:4294967296
     59 
     60 REGION
     61 id:7
     62 lines:18446744073709552000
     63 
     64 REGION
     65 id:8
     66 lines:10000000000000000000000000000000000
     67 
     68 REGION
     69 id:9
     70 lines:1 lines:3
     71 lines:2
     72 
     73 NOTE invalid
     74 
     75 REGION
     76 id:10
     77 lines:-0
     78 
     79 REGION
     80 id:11
     81 lines:1.5
     82 
     83 REGION
     84 id:12
     85 lines:-1
     86 
     87 REGION
     88 id:13
     89 lines: 1
     90 lines :1
     91 
     92 00:00:00.000 --> 00:00:01.000 region:1
     93 text
     94 
     95 00:00:00.000 --> 00:00:01.000 region:2
     96 text
     97 
     98 00:00:00.000 --> 00:00:01.000 region:3
     99 text
    100 
    101 00:00:00.000 --> 00:00:01.000 region:4
    102 text
    103 
    104 00:00:00.000 --> 00:00:01.000 region:5
    105 text
    106 
    107 00:00:00.000 --> 00:00:01.000 region:6
    108 text
    109 
    110 00:00:00.000 --> 00:00:01.000 region:7
    111 text
    112 
    113 00:00:00.000 --> 00:00:01.000 region:8
    114 text
    115 
    116 00:00:00.000 --> 00:00:01.000 region:9
    117 text
    118 
    119 00:00:00.000 --> 00:00:01.000 region:10
    120 text
    121 
    122 00:00:00.000 --> 00:00:01.000 region:11
    123 text
    124 
    125 00:00:00.000 --> 00:00:01.000 region:12
    126 text
    127 
    128 00:00:00.000 --> 00:00:01.000 region:13
    129 text