tor-browser

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

size.html (738B)


      1 <!doctype html>
      2 <title>VTTCue.size</title>
      3 <link rel="help" href="https://w3c.github.io/webvtt/#dom-vttcue-size">
      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 cue = new VTTCue(0, 1, 'text');
     10    assert_true('size' in cue, 'size is not supported');
     11 
     12    for (i = 0; i <= 100; i++) {
     13        cue.size = i;
     14        assert_equals(cue.size, i);
     15    }
     16 
     17    [-1, -100, -101, 101, 200, 201].forEach(function(invalid) {
     18        assert_throws_dom('IndexSizeError', function() {
     19            cue.size = invalid;
     20        });
     21    });
     22 
     23    cue.size = 1.5;
     24    assert_equals(cue.size, 1.5);
     25 }, document.title+', script-created cue');
     26 </script>