tor-browser

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

lines.html (1016B)


      1 <!doctype html>
      2 <title>VTTRegion.lines</title>
      3 <link rel="help" href="https://w3c.github.io/webvtt/#dom-vttregion-lines">
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <div id=log></div>
      7 <script>
      8 test(function() {
      9    var region = new VTTRegion();
     10    assert_true('lines' in region, 'lines is not supported');
     11 
     12    for (var i = 1; i <= 100; i++) {
     13        region.lines = i;
     14        assert_equals(region.lines, i);
     15    }
     16 
     17    // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
     18    [[0, 0],
     19     [-0, 0],
     20     [-1, 4294967295],
     21     [-100, 4294967196],
     22     [101, 101],
     23     [-2147483648, 2147483648],
     24     [2147483647, 2147483647],
     25     [2147483648, 2147483648],
     26     [NaN, 0],
     27     [Infinity, 0],
     28     [-Infinity, 0]].forEach(function (pair) {
     29        var input = pair[0];
     30        var expected = pair[1];
     31        region.lines = input;
     32        assert_equals(region.lines, expected);
     33    });
     34 
     35 }, document.title + ' script-created region');
     36 </script>