tor-browser

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

SourceBuffer-abort.html (1202B)


      1 <!doctype html>
      2 <html>
      3 <head>
      4  <meta charset='utf-8'>
      5  <title>Check the values of appendWindowStart and appendWindowEnd after abort()</title>
      6  <script src="/resources/testharness.js"></script>
      7  <script src="/resources/testharnessreport.js"></script>
      8 </head>
      9 <body>
     10 <div id="log"></div>
     11 
     12 <script>
     13 var mimes = ['video/webm; codecs="vorbis,vp8"', 'video/mp4'];
     14 
     15 mimes.forEach(function(mime) {
     16    async_test(function() {
     17        assert_true(MediaSource.isTypeSupported(mime),
     18                    "Browser doesn't support the MIME used in this test: " + mime);
     19 
     20        var mediaSource = new MediaSource();
     21        mediaSource.addEventListener('sourceopen', this.step_func_done(function(e) {
     22            var sourceBuffer = mediaSource.addSourceBuffer(mime);
     23            sourceBuffer.abort();
     24            assert_equals(sourceBuffer.appendWindowStart, 0);
     25            assert_equals(sourceBuffer.appendWindowEnd, Number.POSITIVE_INFINITY);
     26        }));
     27 
     28        var video = document.createElement('video');
     29        video.src = window.URL.createObjectURL(mediaSource);
     30    }, 'SourceBuffer#abort() (' + mime + '): Check the values of appendWindowStart and appendWindowEnd.');
     31 });
     32 </script>
     33 </body>
     34 </html>