diff options
Diffstat (limited to 'testing/web-platform/tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html')
-rw-r--r-- | testing/web-platform/tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html b/testing/web-platform/tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html new file mode 100644 index 0000000000..928f45bd8f --- /dev/null +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html @@ -0,0 +1,22 @@ +<!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> |