tor-browser

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

audioworkletprocessor-process-zero-outputs.https.html (1123B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>
      5      Test if |outputs| argument is all zero in AudioWorkletProcessor.process()
      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 
     12  <body>
     13    <script>
     14      const audit = Audit.createTaskRunner();
     15      const filePath = 'processors/zero-outputs-check-processor.js';
     16      const context = new AudioContext();
     17 
     18      // Test if the incoming arrays are frozen as expected.
     19      audit.define('check-zero-outputs', (task, should) => {
     20        context.audioWorklet.addModule(filePath).then(() => {
     21          const workletNode =
     22              new AudioWorkletNode(context, 'zero-outputs-check-processor');
     23          workletNode.port.onmessage = (message) => {
     24            const actual = message.data;
     25            if (actual.type === 'assertion') {
     26              should(actual.success, actual.message).beTrue();
     27              task.done();
     28            }
     29          };
     30        });
     31      });
     32 
     33      audit.run();
     34    </script>
     35  </body>
     36 </html>