tor-browser

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

createPeriodicWaveInfiniteValuesThrows.html (819B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>Test AudioContext.createPeriodicWave when inputs contain Infinite values</title>
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <script>
      7 let ctx;
      8 setup(() => {
      9  ctx = new OfflineAudioContext({length: 1, sampleRate: 24000});
     10 });
     11 test(() => {
     12  const real = new Float32Array([0, Infinity]);
     13  const imag = new Float32Array([0, 1]);
     14  assert_throws_js(TypeError, () => ctx.createPeriodicWave(real, imag));
     15 }, "createPeriodicWave with Infinity real values should throw");
     16 
     17 test(() => {
     18  const real = new Float32Array([0, 1]);
     19  const imag = new Float32Array([1, Infinity]);
     20  assert_throws_js(TypeError, () => ctx.createPeriodicWave(real, imag));
     21 }, "createPeriodicWave with Infinity imag values should throw");
     22 </script>