Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset=utf-8>
<title>Test AudioContext.createPeriodicWave when inputs contain Infinite values</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
let ctx;
setup(() => {
ctx = new OfflineAudioContext({length: 1, sampleRate: 24000});
});
test(() => {
const real = new Float32Array([0, Infinity]);
const imag = new Float32Array([0, 1]);
assert_throws_js(TypeError, () => ctx.createPeriodicWave(real, imag));
}, "createPeriodicWave with Infinity real values should throw");
test(() => {
const real = new Float32Array([0, 1]);
const imag = new Float32Array([1, Infinity]);
assert_throws_js(TypeError, () => ctx.createPeriodicWave(real, imag));
}, "createPeriodicWave with Infinity imag values should throw");
</script>