tor-browser

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

audiocontext-detached-execution-context.html (995B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <title>
      5      Testing behavior of AudioContext 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        let context = new iframe.contentWindow.AudioContext();
     20        document.body.removeChild(iframe);
     21 
     22        should(context.decodeAudioData(new ArrayBuffer(1)),
     23               'decodeAudioData() upon a detached iframe')
     24            .beRejectedWith('InvalidStateError')
     25            .then(() => task.done());
     26      });
     27 
     28      audit.run();
     29    </script>
     30  </body>
     31 </html>