tor-browser

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

offlineaudiocontext-detached-execution-context.html (1062B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <title>
      5      Testing behavior OfflineAudioContext after execution context is detached
      6    </title>
      7    <script src="/resources/testharness.js"></script>
      8    <script src="/resources/testharnessreport.js"></script>
      9    <script src="/webaudio/resources/audit.js"></script>
     10  </head>
     11  <body>
     12    <script id="layout-test-code">
     13      const audit = Audit.createTaskRunner();
     14 
     15      audit.define('decoding-on-detached-iframe', (task, should) => {
     16        const iframe =
     17            document.createElementNS("http://www.w3.org/1999/xhtml", "iframe");
     18        document.body.appendChild(iframe);
     19 
     20        // Use the lowest value possible for the faster test.
     21        let context =
     22            new iframe.contentWindow.OfflineAudioContext(1, 1, 8000);
     23 
     24        document.body.removeChild(iframe);
     25 
     26        return should(context.decodeAudioData(new ArrayBuffer(1)),
     27               'decodeAudioData() upon a detached iframe')
     28            .beRejectedWith('InvalidStateError');
     29      });
     30 
     31      audit.run();
     32    </script>
     33  </body>
     34 </html>