diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index e25096267d517..422af18860537 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -654315,7 +654315,7 @@ "support" ], "webaudio/resources/audionodeoptions.js": [ - "0d90a9c630013b9b46ba49c106e0daa89da7032e", + "df0090c6d605fc0ea5fca224de83e0f472618f9a", "support" ], "webaudio/resources/audioparam-testing.js": [ @@ -654327,7 +654327,7 @@ "support" ], "webaudio/resources/audit.js": [ - "7ffa4392b05a15dfacafa7d89c902d977ed23266", + "b7ca020161071437087c349c0e8b59dbf132f764", "support" ], "webaudio/resources/biquad-filters.js": [ @@ -654379,7 +654379,7 @@ "support" ], "webaudio/resources/start-stop-exceptions.js": [ - "9a77e67ed8634ca53237edcdbf71ca26866b23f9", + "0d2ea12f6db8257878087646157242cce37ed507", "support" ], "webaudio/resources/stereopanner-testing.js": [ @@ -654391,7 +654391,7 @@ "support" ], "webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html": [ - "2112edeeffcf5688357d98b5161e6c3ab2d761ad", + "4e27f842ddeda3e2bdd78da7b8ee3f67062d1a9f", "testharness" ], "webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-basic.html": [ @@ -654403,7 +654403,7 @@ "testharness" ], "webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-sizing.html": [ - "b3de37f119f167469a4337d520345f820a6c4165", + "7ee6a2237edd209256ac2d46be6893a5305383a0", "testharness" ], "webaudio/the-audio-api/the-analysernode-interface/test-analyser-gain.html": [ @@ -654431,7 +654431,7 @@ "support" ], "webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html": [ - "b71078d8f8094cdc43ba3adfc33d0f6f15931b33", + "e0359953d2e909f69066885515f4a3f3cc00ff02", "testharness" ], "webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-getChannelData.html": [ @@ -654439,11 +654439,11 @@ "testharness" ], "webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer.html": [ - "07a34f07c185f4bc9dcf1b325bb51067610b430a", + "a2c4581c4e80069f227fe29078bc3eb6409c8b4e", "testharness" ], "webaudio/the-audio-api/the-audiobuffer-interface/ctor-audiobuffer.html": [ - "c5aae1ad53235f7b0f10bc3535d9a3fe5150760f", + "9845d5eaba384cced3c63ddbf4df1400b31f4994", "testharness" ], "webaudio/the-audio-api/the-audiobuffersourcenode-interface/.gitkeep": [ @@ -654455,7 +654455,7 @@ "testharness" ], "webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-channels.html": [ - "5527f44cc9c93e72214ca228fa53e830a8cfcead", + "f3f16c4c648166dfdb394a41881d4a515d097e86", "testharness" ], "webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-ended.html": [ @@ -654543,7 +654543,7 @@ "testharness" ], "webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html": [ - "0a8c73160e543d6f9d382b536e5c41f7d29c6e9a", + "4163a8439cd08c1f8cdcb587c569653c2618e021", "testharness" ], "webaudio/the-audio-api/the-audionode-interface/audionode-connect-order.html": [ @@ -654555,15 +654555,15 @@ "testharness" ], "webaudio/the-audio-api/the-audionode-interface/audionode-disconnect-audioparam.html": [ - "c3d3fae2155602bbae7494e0e1439ea1a477b054", + "386614ff2e20e7abd4e511bf5e9d7d492cddfeb3", "testharness" ], "webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html": [ - "b29c09d395fc2815ee5441fdb06320ad02f2f3f5", + "65b93222d1002e227ab1ad2e29b6e140b65bd9e4", "testharness" ], "webaudio/the-audio-api/the-audionode-interface/audionode.html": [ - "14cfbff7e2754c4ee028c7ead599e87849a60922", + "0b57d27e8e1a7b7339d0e47641cbba27ab419612", "testharness" ], "webaudio/the-audio-api/the-audionode-interface/channel-mode-interp-basic.html": [ @@ -654607,7 +654607,7 @@ "testharness" ], "webaudio/the-audio-api/the-audioparam-interface/audioparam-setValueCurve-exceptions.html": [ - "7990d0aee134cb33082e058b41bdaafc69bb507e", + "df36732c3479f48fbb77a60176cdfa22f58a3611", "testharness" ], "webaudio/the-audio-api/the-audioparam-interface/audioparam-setValueCurveAtTime.html": [ @@ -654623,7 +654623,7 @@ "support" ], "webaudio/the-audio-api/the-audioparam-interface/automation-rate.html": [ - "a3c789e2f2cbdb31e540bf5cc58850786b4ed73b", + "a3c11994bbe37f26aa1c2eafbb4f287d559fae34", "testharness" ], "webaudio/the-audio-api/the-audioparam-interface/event-insertion.html": [ @@ -654731,11 +654731,11 @@ "testharness" ], "webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-construction.https.html": [ - "7cfd423c071b9a8283e291f200615b2e0a69c797", + "8b7704a781b712c0129b650da898ed79baad794c", "testharness" ], "webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-constructor-options.https.html": [ - "31e204cdc8d53bfaf0226c34a0e5daf42c813b61", + "cee9ec82c20f42a5941698fc394e6babb639ace9", "testharness" ], "webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-disconnected-input.https.html": [ @@ -654811,7 +654811,7 @@ "testharness" ], "webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html": [ - "83f53aafb1980bf991f4d12c3a3a472b82df61a6", + "441e98a251187c3cc600299681306d29df11e618", "testharness" ], "webaudio/the-audio-api/the-biquadfilternode-interface/biquad-getFrequencyResponse.html": [ @@ -654863,7 +654863,7 @@ "support" ], "webaudio/the-audio-api/the-channelmergernode-interface/audiochannelmerger-basic.html": [ - "f967f0699a321783fe832464b6e72a2a12021746", + "71a62f176f8eefd9b9168b2c222cc6d1c752d3a5", "testharness" ], "webaudio/the-audio-api/the-channelmergernode-interface/audiochannelmerger-disconnect.html": [ @@ -654879,7 +654879,7 @@ "testharness" ], "webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html": [ - "115bd9943490ab09efbff70239167911eb83d933", + "0d6b45c56df0f43a0eac3f364cadca2e4669c6ed", "testharness" ], "webaudio/the-audio-api/the-channelsplitternode-interface/.gitkeep": [ @@ -654887,11 +654887,11 @@ "support" ], "webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html": [ - "e0449919ad5e744065bb0257dddfe9b488511812", + "954c71a96b288530e6c22878fed7a91f42091dc2", "testharness" ], "webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html": [ - "7fa9d6fa5466d2fbfeec8bbcf0718b80b52d2298", + "9cbb46b6d969a6440fc5b29ee1a20d607912fc83", "testharness" ], "webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html": [ @@ -654927,7 +654927,7 @@ "testharness" ], "webaudio/the-audio-api/the-convolvernode-interface/convolver-channels.html": [ - "11d6f332a1bbc943bec1ad7391610ffe776b955c", + "ac4f198d7c1449f38ca14963f73b0d3d90b40b5b", "testharness" ], "webaudio/the-audio-api/the-convolvernode-interface/convolver-response-1-chan.html": [ @@ -654943,7 +654943,7 @@ "testharness" ], "webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html": [ - "31f115da5321ef52be0ee1ba078b726473694b9c", + "c8dbeb941bc48f4f3a92907cb140a29f96567057", "testharness" ], "webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-null.html": [ @@ -654955,7 +654955,7 @@ "testharness" ], "webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html": [ - "cf818330060143078cacbecf77724244eee55cf8", + "935ceeb715edd2ffdeb7979d6824736fa82b6d2f", "testharness" ], "webaudio/the-audio-api/the-delaynode-interface/.gitkeep": [ @@ -654983,7 +654983,7 @@ "testharness" ], "webaudio/the-audio-api/the-delaynode-interface/delaynode-maxdelaylimit.html": [ - "7bbff410650c3bd234c47f080697705b088bd6a4", + "caf2f85dfd459b2d48526b8f4c13b37b2bceaddb", "testharness" ], "webaudio/the-audio-api/the-delaynode-interface/delaynode-scheduling.html": [ @@ -655003,7 +655003,7 @@ "support" ], "webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html": [ - "98d5dbfded1e2f10e32b14444279760fa2cdeec1", + "c2460dfa1ddd26a5c2e199873c0b28189275ff83", "testharness" ], "webaudio/the-audio-api/the-dynamicscompressornode-interface/dynamicscompressor-basic.html": [ @@ -655043,7 +655043,7 @@ "testharness" ], "webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.html": [ - "79c40dc084753d48970212eafd97ef531c0ae402", + "7828f05226151ebf7d6c7ec984cae1f90ef848d2", "testharness" ], "webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-getFrequencyResponse.html": [ @@ -655079,7 +655079,7 @@ "support" ], "webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html": [ - "f480ec8ce51f929417b922adf60a2f9ede800fcd", + "4b6863103622c5fb248dee3e3eb20d955275d037", "testharness" ], "webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html": [ @@ -655091,7 +655091,7 @@ "support" ], "webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html": [ - "aaf77aec555b720b343a9e63adae924c730510dc", + "36bf604b296c63b213d99408ab38937c62a755dc", "testharness" ], "webaudio/the-audio-api/the-pannernode-interface/.gitkeep": [ @@ -655099,7 +655099,7 @@ "support" ], "webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html": [ - "5475a6210b724ab2d6a0cefedee9c5432953c61f", + "98a171ad059eaf9b8e24f3f46db4658f76773f19", "testharness" ], "webaudio/the-audio-api/the-pannernode-interface/distance-exponential.html": [ @@ -655159,7 +655159,7 @@ "support" ], "webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html": [ - "caa99aa4031a22f8c538e5622470560a50c4d5bc", + "9409f1ffce2110c177332388988d7ddb559d3ae2", "testharness" ], "webaudio/the-audio-api/the-stereopanner-interface/no-dezippering.html": [ diff --git a/testing/web-platform/tests/webaudio/resources/audionodeoptions.js b/testing/web-platform/tests/webaudio/resources/audionodeoptions.js index f591a125a94fb..8a8c6716b61de 100644 --- a/testing/web-platform/tests/webaudio/resources/audionodeoptions.js +++ b/testing/web-platform/tests/webaudio/resources/audionodeoptions.js @@ -40,19 +40,19 @@ function testAudioNodeOptions(should, context, nodeName, expectedNodeOptions) { {channelCount: testChannelCount})); }, 'new ' + nodeName + '(c, {channelCount: ' + testChannelCount + '}}') - .throw(expectedNodeOptions.channelCount.errorType || TypeError); + .throw(DOMException, + expectedNodeOptions.channelCount.exceptionType); } else { - let errorType = 'NotSupportedError'; - [0, 99].forEach(testValue => { should(() => { node = new window[nodeName]( context, Object.assign({}, expectedNodeOptions.additionalOptions, { channelCount: testValue })); - }, `new ${nodeName}(c, {channelCount: ${testValue}})`).throw(errorType); + }, `new ${nodeName}(c, {channelCount: ${testValue}})`) + .throw(DOMException, 'NotSupportedError'); }); } @@ -88,7 +88,8 @@ function testAudioNodeOptions(should, context, nodeName, expectedNodeOptions) { {channelCountMode: testValue})); }, `new ${nodeName}(c, {channelCountMode: "${testValue}"})`) - .throw(expectedNodeOptions.channelCountMode.errorType); + .throw(DOMException, + expectedNodeOptions.channelCountMode.exceptionType); } }); } else { @@ -140,7 +141,8 @@ function testAudioNodeOptions(should, context, nodeName, expectedNodeOptions) { {channelInterpretation: testValue})); }, `new ${nodeName}(c, {channelInterpretation: "${testValue}"})`) - .throw(expectedNodeOptions.channelInterpretation.errorType); + .throw(DOMException, + expectedNodeOptions.channelCountMode.exceptionType); } }); } else { diff --git a/testing/web-platform/tests/webaudio/resources/audit.js b/testing/web-platform/tests/webaudio/resources/audit.js index 4d7dc1d222467..7764521bbe2d3 100644 --- a/testing/web-platform/tests/webaudio/resources/audit.js +++ b/testing/web-platform/tests/webaudio/resources/audit.js @@ -288,6 +288,10 @@ window.Audit = (function() { + + + + @@ -313,17 +317,16 @@ window.Audit = (function() { didThrowCorrectly = true; passDetail = '${actual} threw ' + error.name + errorMessage + '.'; - } else if (typeof(this._expected) == "string" && - error instanceof DOMException && - error.name === this._expected) { + } else if (this._expected === DOMException && + (this._expectedDescription === undefined || + this._expectedDescription === error.name)) { didThrowCorrectly = true; passDetail = '${actual} threw ${expected}' + errorMessage + '.'; - } else if (this._expected == error.constructor && - this._expected.name == error.name) { + } else if (this._expected == error.constructor) { didThrowCorrectly = true; - passDetail = '${actual} threw ${expected}' + errorMessage + '.'; + passDetail = '${actual} threw ' + error.name + errorMessage + '.'; } else { didThrowCorrectly = false; failDetail = diff --git a/testing/web-platform/tests/webaudio/resources/start-stop-exceptions.js b/testing/web-platform/tests/webaudio/resources/start-stop-exceptions.js index d681021ea075d..3e89714ba038e 100644 --- a/testing/web-platform/tests/webaudio/resources/start-stop-exceptions.js +++ b/testing/web-platform/tests/webaudio/resources/start-stop-exceptions.js @@ -13,7 +13,7 @@ function testStartStop(should, node, options) { should(() => { node.stop(); - }, 'Calling stop() before start()').throw('InvalidStateError'); + }, 'Calling stop() before start()').throw(DOMException, 'InvalidStateError'); should(() => { node.start(-1); @@ -29,7 +29,7 @@ function testStartStop(should, node, options) { node.start(); should(() => { node.start(); - }, 'Calling start() twice').throw('InvalidStateError'); + }, 'Calling start() twice').throw(DOMException, 'InvalidStateError'); should(() => { node.stop(-1); }, 'stop(-1)').throw(RangeError); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html b/testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html index 2112edeeffcf5..4e27f842ddeda 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html @@ -91,25 +91,25 @@ node = new AnalyserNode(context, {fftSize: 33}); }, 'node = new AnalyserNode(c, { fftSize: 33 })') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should( () => { node = new AnalyserNode(context, {maxDecibels: -500}); }, 'node = new AnalyserNode(c, { maxDecibels: -500 })') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should( () => { node = new AnalyserNode(context, {minDecibels: -10}); }, 'node = new AnalyserNode(c, { minDecibels: -10 })') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should( () => { node = new AnalyserNode(context, {smoothingTimeConstant: 2}); }, 'node = new AnalyserNode(c, { smoothingTimeConstant: 2 })') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should(function() { node = new AnalyserNode(context, {frequencyBinCount: 33}); }, 'node = new AnalyserNode(c, { frequencyBinCount: 33 })').notThrow(); @@ -164,7 +164,7 @@ node = new AnalyserNode(context, options); }, 'node = new AnalyserNode(c, ' + JSON.stringify(options) + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); options = {minDecibels: -10, maxDecibels: -150}; should( @@ -172,7 +172,7 @@ node = new AnalyserNode(context, options); }, 'node = new AnalyserNode(c, ' + JSON.stringify(options) + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-sizing.html b/testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-sizing.html index b3de37f119f16..7ee6a2237edd2 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-sizing.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-sizing.html @@ -22,7 +22,7 @@ }; if (illegal) { - should(tester, message).throw('IndexSizeError'); + should(tester, message).throw(DOMException, 'IndexSizeError'); } else { should(tester, message).notThrow(); } diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html index b71078d8f8094..e0359953d2e90 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html @@ -127,27 +127,27 @@ }, '2: buffer.copyFromChannel(context, 0)').throw(TypeError); should(() => { buffer.copyFromChannel(x, -1); - }, '3: buffer.copyFromChannel(x, -1)').throw('IndexSizeError'); + }, '3: buffer.copyFromChannel(x, -1)').throw(DOMException, 'IndexSizeError'); should( () => { buffer.copyFromChannel(x, numberOfChannels); }, '4: buffer.copyFromChannel(x, ' + numberOfChannels + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); ; should(() => { buffer.copyFromChannel(x, 0, -1); - }, '5: buffer.copyFromChannel(x, 0, -1)').throw('IndexSizeError'); + }, '5: buffer.copyFromChannel(x, 0, -1)').throw(DOMException, 'IndexSizeError'); should( () => { buffer.copyFromChannel(x, 0, bufferLength); }, '6: buffer.copyFromChannel(x, 0, ' + bufferLength + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should(() => { buffer.copyFromChannel(x, 3); - }, '7: buffer.copyFromChannel(x, 3)').throw('IndexSizeError'); + }, '7: buffer.copyFromChannel(x, 3)').throw(DOMException, 'IndexSizeError'); if (window.SharedArrayBuffer) { let shared_buffer = new Float32Array(new SharedArrayBuffer(32)); @@ -183,26 +183,26 @@ }, '1: buffer.copyToChannel(context, 0)').throw(TypeError); should(() => { buffer.copyToChannel(x, -1); - }, '2: buffer.copyToChannel(x, -1)').throw('IndexSizeError'); + }, '2: buffer.copyToChannel(x, -1)').throw(DOMException, 'IndexSizeError'); should( () => { buffer.copyToChannel(x, numberOfChannels); }, '3: buffer.copyToChannel(x, ' + numberOfChannels + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should(() => { buffer.copyToChannel(x, 0, -1); - }, '4: buffer.copyToChannel(x, 0, -1)').throw('IndexSizeError'); + }, '4: buffer.copyToChannel(x, 0, -1)').throw(DOMException, 'IndexSizeError'); should( () => { buffer.copyToChannel(x, 0, bufferLength); }, '5: buffer.copyToChannel(x, 0, ' + bufferLength + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should(() => { buffer.copyToChannel(x, 3); - }, '6: buffer.copyToChannel(x, 3)').throw('IndexSizeError'); + }, '6: buffer.copyToChannel(x, 3)').throw(DOMException, 'IndexSizeError'); if (window.SharedArrayBuffer) { let shared_buffer = new Float32Array(new SharedArrayBuffer(32)); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer.html index 07a34f07c185f..a2c4581c4e800 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer.html @@ -53,7 +53,7 @@ buffer.getChannelData(buffer.numberOfChannels); }, 'buffer.getChannelData(' + buffer.numberOfChannels + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); let buffer2 = context.createBuffer(1, 1000, 24576); let expectedDuration = 1000 / 24576; diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/ctor-audiobuffer.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/ctor-audiobuffer.html index c5aae1ad53235..9845d5eaba384 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/ctor-audiobuffer.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/ctor-audiobuffer.html @@ -96,7 +96,7 @@ let buffer = new AudioBuffer(options); }, 'new AudioBuffer(' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); options = {numberOfChannels: 99, length: 0, sampleRate: 16000}; should( @@ -104,7 +104,7 @@ let buffer = new AudioBuffer(options); }, 'new AudioBuffer(' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); options = {numberOfChannels: 1, length: 0, sampleRate: 16000}; should( @@ -112,7 +112,7 @@ let buffer = new AudioBuffer(options); }, 'new AudioBuffer(' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); options = {numberOfChannels: 1, length: 1, sampleRate: 100}; should( @@ -120,7 +120,7 @@ let buffer = new AudioBuffer(options); }, 'new AudioBuffer(' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); task.done(); }); @@ -178,7 +178,7 @@ buffer.getChannelData(options.numberOfChannels); }, 'buffer.getChannelData(' + options.numberOfChannels + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-channels.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-channels.html index 5527f44cc9c93..f3f16c4c64816 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-channels.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-channels.html @@ -47,7 +47,7 @@ should(function() { source.buffer = new AudioBuffer({length: 128, sampleRate: context.sampleRate}) - }, 'source.buffer = new buffer').throw('InvalidStateError'); + }, 'source.buffer = new buffer').throw(DOMException, 'InvalidStateError'); // The buffer has been set; it's ok to set it to null. should(function() { @@ -58,7 +58,7 @@ // again. should(function() { source.buffer = buffer; - }, 'source.buffer = buffer again').throw('InvalidStateError'); + }, 'source.buffer = buffer again').throw(DOMException, 'InvalidStateError'); // But setting to null is ok. should(function() { diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html index 0a8c73160e543..4163a8439cd08 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html @@ -114,7 +114,7 @@ // does not have the second output, so it should throw. should(function() { gain1.connect(gain2, 1).connect(contextA.destination); - }, 'Connecting with an invalid output').throw('IndexSizeError'); + }, 'Connecting with an invalid output').throw(DOMException, 'IndexSizeError'); // Test if the second connection throws correctly. The contextB's // destination is not compatible with the nodes from contextA, thus the @@ -124,7 +124,7 @@ gain1.connect(gain2).connect(contextB.destination); }, 'Connecting to a node from the different context') - .throw('InvalidAccessError'); + .throw(DOMException, 'InvalidAccessError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect-audioparam.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect-audioparam.html index c3d3fae215560..386614ff2e20e 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect-audioparam.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect-audioparam.html @@ -193,17 +193,17 @@ // gain1 is not connected to gain3.gain. Exception should be thrown. should(function() { gain1.disconnect(gain3.gain); - }, 'gain1.disconnect(gain3.gain)').throw('InvalidAccessError'); + }, 'gain1.disconnect(gain3.gain)').throw(DOMException, 'InvalidAccessError'); // When the output index is good but the destination is invalid. should(function() { splitter.disconnect(gain1.gain, 1); - }, 'splitter.disconnect(gain1.gain, 1)').throw('InvalidAccessError'); + }, 'splitter.disconnect(gain1.gain, 1)').throw(DOMException, 'InvalidAccessError'); // When both arguments are wrong, throw IndexSizeError first. should(function() { splitter.disconnect(gain1.gain, 2); - }, 'splitter.disconnect(gain1.gain, 2)').throw('IndexSizeError'); + }, 'splitter.disconnect(gain1.gain, 2)').throw(DOMException, 'IndexSizeError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html index b29c09d395fc2..65b93222d1002 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html @@ -230,7 +230,7 @@ // There is no output #2. An exception should be thrown. should(function() { splitter.disconnect(2); - }, 'splitter.disconnect(2)').throw('IndexSizeError'); + }, 'splitter.disconnect(2)').throw(DOMException, 'IndexSizeError'); // Disconnecting the output already disconnected should not throw. should(function() { @@ -241,34 +241,34 @@ // gain1 is not connected gain2. An exception should be thrown. should(function() { gain1.disconnect(gain2); - }, 'gain1.disconnect(gain2)').throw('InvalidAccessError'); + }, 'gain1.disconnect(gain2)').throw(DOMException, 'InvalidAccessError'); // gain1 and gain3 are not connected. An exception should be thrown. should(function() { gain1.disconnect(gain3); - }, 'gain1.disconnect(gain3)').throw('InvalidAccessError'); + }, 'gain1.disconnect(gain3)').throw(DOMException, 'InvalidAccessError'); // There is no output #2 in the splitter. An exception should be thrown. should(function() { splitter.disconnect(gain2, 2); - }, 'splitter.disconnect(gain2, 2)').throw('IndexSizeError'); + }, 'splitter.disconnect(gain2, 2)').throw(DOMException, 'IndexSizeError'); // The splitter and gain1 are not connected. An exception should be // thrown. should(function() { splitter.disconnect(gain1, 0); - }, 'splitter.disconnect(gain1, 0)').throw('InvalidAccessError'); + }, 'splitter.disconnect(gain1, 0)').throw(DOMException, 'InvalidAccessError'); // The splitter output #0 and the gain3 output #0 are not connected. An // exception should be thrown. should(function() { splitter.disconnect(gain3, 0, 0); - }, 'splitter.disconnect(gain3, 0, 0)').throw('InvalidAccessError'); + }, 'splitter.disconnect(gain3, 0, 0)').throw(DOMException, 'InvalidAccessError'); // The output index is out of bound. An exception should be thrown. should(function() { splitter.disconnect(merger, 3, 0); - }, 'splitter.disconnect(merger, 3, 0)').throw('IndexSizeError'); + }, 'splitter.disconnect(merger, 3, 0)').throw(DOMException, 'IndexSizeError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode.html index 14cfbff7e2754..0b57d27e8e1a7 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audionode-interface/audionode.html @@ -54,11 +54,11 @@ should( () => audioNode.connect(context.destination, 5, 0), 'audioNode.connect(context.destination, 5, 0)') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should( () => audioNode.connect(context.destination, 0, 5), 'audioNode.connect(context.destination, 0, 5)') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); should( () => audioNode.connect(context.destination, 0, 0), @@ -71,7 +71,7 @@ should( () => window.audioNode.connect(context2.destination), 'Connecting a node to a different context') - .throw('InvalidAccessError'); + .throw(DOMException, 'InvalidAccessError'); // 3-arg AudioContext doesn't create an offline context anymore. should( diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-setValueCurve-exceptions.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-setValueCurve-exceptions.html index 7990d0aee134c..df36732c3479f 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-setValueCurve-exceptions.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-setValueCurve-exceptions.html @@ -46,28 +46,28 @@ g.gain.setValueAtTime(1, automationTime); }, 'setValueAtTime(1, ' + automationTime + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); should( function() { g.gain.linearRampToValueAtTime(1, automationTime); }, 'linearRampToValueAtTime(1, ' + automationTime + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); should( function() { g.gain.exponentialRampToValueAtTime(1, automationTime); }, 'exponentialRampToValueAtTime(1, ' + automationTime + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); should( function() { g.gain.setTargetAtTime(1, automationTime, 1); }, 'setTargetAtTime(1, ' + automationTime + ', 1)') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); should( function() { @@ -120,7 +120,7 @@ g.gain.setValueCurveAtTime(curve, time, 0.01); }, 'setValueCurveAtTime(curve, ' + time + ', 0.01)') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); } // Elements of setValueCurve should be finite. @@ -167,7 +167,7 @@ g.gain.setValueCurveAtTime(curve, time, 0.01); }, 'setValueCurveAtTime(curve, ' + time + ', 0.01)') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); task.done(); }); @@ -369,14 +369,14 @@ g.gain.setValueCurveAtTime(Float32Array.from([]), time, 0.01); }, 'setValueCurveAtTime([], ' + time + ', 0.01)') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); should( () => { g.gain.setValueCurveAtTime(Float32Array.from([1]), time, 0.01); }, 'setValueCurveAtTime([1], ' + time + ', 0.01)') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); should(() => { g.gain.setValueCurveAtTime(Float32Array.from([1, 2]), time, 0.01); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/automation-rate.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/automation-rate.html index a3c789e2f2cbd..a3c11994bbe37 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/automation-rate.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/automation-rate.html @@ -151,7 +151,7 @@ if (param.isFixed) { should(() => audioParam.automationRate = newRate, setMessage) - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); } else { should(() => audioParam.automationRate = newRate, setMessage) diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-construction.https.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-construction.https.html index 7cfd423c071b9..8b7704a781b71 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-construction.https.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-construction.https.html @@ -23,7 +23,7 @@ (task, should) => { should(() => new AudioWorkletNode(realtimeContext, 'dummy'), 'Creating a node before loading a module should throw.') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-constructor-options.https.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-constructor-options.https.html index 31e204cdc8d53..cee9ec82c20f4 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-constructor-options.https.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-constructor-options.https.html @@ -90,13 +90,13 @@ should( () => new AudioWorkletNode(context, 'dummy', options2), 'Creating AudioWorkletNode with channelCount 0') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); const options3 = {channelCount: 33}; should( () => new AudioWorkletNode(context, 'dummy', options3), 'Creating AudioWorkletNode with channelCount 33') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html b/testing/web-platform/tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html index 83f53aafb1980..441e98a251187 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html @@ -110,7 +110,7 @@ 'new Float32Array(10), ' + 'new Float32Array(1), ' + 'new Float32Array(20))') - .throw('InvalidAccessError'); + .throw(DOMException, 'InvalidAccessError'); should( function() { @@ -123,7 +123,7 @@ 'new Float32Array(10), ' + 'new Float32Array(20), ' + 'new Float32Array(1))') - .throw('InvalidAccessError'); + .throw(DOMException, 'InvalidAccessError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-channelmergernode-interface/audiochannelmerger-basic.html b/testing/web-platform/tests/webaudio/the-audio-api/the-channelmergernode-interface/audiochannelmerger-basic.html index f967f0699a321..71a62f176f8ee 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-channelmergernode-interface/audiochannelmerger-basic.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-channelmergernode-interface/audiochannelmerger-basic.html @@ -24,7 +24,7 @@ should(function() { merger = context.createChannelMerger(0); - }, 'context.createChannelMerger(0)').throw('IndexSizeError'); + }, 'context.createChannelMerger(0)').throw(DOMException, 'IndexSizeError'); should(function() { merger = context.createChannelMerger(32); @@ -34,7 +34,7 @@ // context has a 32-channel-limit in Chrome. should(function() { merger = context.createChannelMerger(33); - }, 'context.createChannelMerger(33)').throw('IndexSizeError'); + }, 'context.createChannelMerger(33)').throw(DOMException, 'IndexSizeError'); task.done(); }); @@ -49,14 +49,14 @@ should(function() { merger.channelCount = 3; - }, 'merger.channelCount = 3').throw('InvalidStateError'); + }, 'merger.channelCount = 3').throw(DOMException, 'InvalidStateError'); should(merger.channelCountMode, 'merger.channelCountMode') .beEqualTo('explicit'); should(function() { merger.channelCountMode = 'max'; - }, 'merger.channelCountMode = "max"').throw('InvalidStateError'); + }, 'merger.channelCountMode = "max"').throw(DOMException, 'InvalidStateError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html b/testing/web-platform/tests/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html index 115bd9943490a..0d6b45c56df0f 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html @@ -43,12 +43,15 @@ audit.define('test AudioNodeOptions', (task, should) => { testAudioNodeOptions(should, context, 'ChannelMergerNode', { - channelCount: - {value: 1, isFixed: true, errorType: 'InvalidStateError'}, + channelCount: { + value: 1, + isFixed: true, + exceptionType: 'InvalidStateError' + }, channelCountMode: { value: 'explicit', isFixed: true, - errorType: 'InvalidStateError' + exceptionType: 'InvalidStateError' } }); task.done(); @@ -82,7 +85,7 @@ node = new ChannelMergerNode(context, options); }, 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); options = {channelCount: 3}; should( @@ -90,7 +93,7 @@ node = new ChannelMergerNode(context, options); }, 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); options = {channelCountMode: 'max'}; should( @@ -98,7 +101,7 @@ node = new ChannelMergerNode(context, options); }, 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html b/testing/web-platform/tests/webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html index 886c27ba2491d..469a9dd6911f9 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html @@ -75,11 +75,11 @@ let splitternode; should(() => { let splitternode = context.createChannelSplitter(0); - }, 'createChannelSplitter(0)').throw('IndexSizeError'); + }, 'createChannelSplitter(0)').throw(DOMException, 'IndexSizeError'); should(() => { splitternode = context.createChannelSplitter(33); - }, 'createChannelSplitter(33)').throw('IndexSizeError'); + }, 'createChannelSplitter(33)').throw(DOMException, 'IndexSizeError'); should(() => { splitternode = context.createChannelSplitter(32); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html b/testing/web-platform/tests/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html index 7fa9d6fa5466d..9cbb46b6d969a 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html @@ -41,8 +41,11 @@ audit.define('test AudioNodeOptions', (task, should) => { testAudioNodeOptions(should, context, 'ChannelSplitterNode', { - channelCount: - {value: 6, isFixed: true, errorType: 'InvalidStateError'}, + channelCount: { + value: 6, + isFixed: true, + exceptionType: 'InvalidStateError' + }, channelCountMode: { value: 'explicit', isFixed: true, @@ -50,7 +53,7 @@ channelInterpretation: { value: 'discrete', isFixed: true, - errorType: 'InvalidStateError' + exceptionType: 'InvalidStateError' }, }); task.done(); @@ -84,7 +87,7 @@ node = new ChannelSplitterNode(context, options); }, 'new ChannelSplitterNode(c, ' + JSON.stringify(options) + ')') - .throw('IndexSizeError'); + .throw(DOMException, 'IndexSizeError'); options = {channelCount: 3}; should( @@ -92,7 +95,7 @@ node = new ChannelSplitterNode(context, options); }, 'new ChannelSplitterNode(c, ' + JSON.stringify(options) + ')') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); options = {channelCountMode: 'max'}; should( @@ -100,7 +103,7 @@ node = new ChannelSplitterNode(context, options); }, 'new ChannelSplitterNode(c, ' + JSON.stringify(options) + ')') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-channels.html b/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-channels.html index 11d6f332a1bbc..ac4f198d7c144 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-channels.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-channels.html @@ -30,7 +30,7 @@ should(() => convolver.buffer = buffer, message).notThrow(); } else { should(() => convolver.buffer = buffer, message) - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); } } diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html b/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html index 31f115da5321e..c8dbeb941bc48 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html @@ -27,7 +27,7 @@ should(() => { convolver.buffer = audioBuffer; - }, 'Set buffer a second time').throw('InvalidStateError'); + }, 'Set buffer a second time').throw(DOMException, 'InvalidStateError'); should(() => { convolver.buffer = null; @@ -40,7 +40,7 @@ should(() => { convolver.buffer = audioBuffer; }, 'Set buffer to non-null to verify to throw an error') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html b/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html index cf81833006014..935ceeb715edd 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver.html @@ -46,12 +46,15 @@ audit.define('test AudioNodeOptions', (task, should) => { testAudioNodeOptions(should, context, 'ConvolverNode', { - channelCount: - {value: 2, isFixed: true, errorType: 'NotSupportedError'}, + channelCount: { + value: 2, + isFixed: true, + exceptionType: 'NotSupportedError' + }, channelCountMode: { value: 'clamped-max', isFixed: true, - errorType: 'NotSupportedError' + exceptionType: 'NotSupportedError' }, }); task.done(); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-delaynode-interface/delaynode-maxdelaylimit.html b/testing/web-platform/tests/webaudio/the-audio-api/the-delaynode-interface/delaynode-maxdelaylimit.html index 7bbff410650c3..caf2f85dfd459 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-delaynode-interface/delaynode-maxdelaylimit.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-delaynode-interface/delaynode-maxdelaylimit.html @@ -32,14 +32,18 @@ bufferSource.buffer = toneBuffer; window.context = context; - should(() => context.createDelay(180)).throw("NotSupportedError", - "Delay length cannot be 180 seconds or more"); - should(() => context.createDelay(0)).throw("NotSupportedError", - "Delay length cannot be 0"); - should(() => context.createDelay(-1)).throw("NotSupportedError", - "Delay length cannot be negative"); - should(() => context.createDelay(NaN)).throw(TypeError, - "Delay length cannot be a NaN"); + should(() => context.createDelay(180), + 'Setting Delay length to 180 seconds or more') + .throw(DOMException, 'NotSupportedError'); + should(() => context.createDelay(0), + 'Setting Delay length to 0 seconds') + .throw(DOMException, 'NotSupportedError'); + should(() => context.createDelay(-1), + 'Setting Delay length to negative') + .throw(DOMException, 'NotSupportedError'); + should(() => context.createDelay(NaN), + 'Setting Delay length to NaN') + .throw(TypeError); let delay = context.createDelay(179); delay.delayTime.value = delayTimeSeconds; diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html b/testing/web-platform/tests/webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html index 98d5dbfded1e2..c2460dfa1ddd2 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html @@ -182,9 +182,12 @@ let message = 'new DynamicsCompressorNode(c, ' + JSON.stringify(options.nodeOptions) + ')'; - if (options.expectedErrorType) { + if (options.expectedErrorType === TypeError) { should(createNodeFunction(), message) .throw(options.expectedErrorType); + } else if (options.expectedErrorType === 'NotSupportedError') { + should(createNodeFunction(), message) + .throw(DOMException, 'NotSupportedError'); } else { should(createNodeFunction(), message).notThrow(); should(node[options.testAttribute], 'node.' + options.testAttribute) diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.html b/testing/web-platform/tests/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.html index 79c40dc084753..7828f05226151 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.html @@ -66,17 +66,17 @@ should(function() { // There has to be at least one coefficient. context.createIIRFilter([], []); - }, 'createIIRFilter([], [])').throw('NotSupportedError'); + }, 'createIIRFilter([], [])').throw(DOMException, 'NotSupportedError'); should(function() { // There has to be at least one coefficient. context.createIIRFilter([1], []); - }, 'createIIRFilter([1], [])').throw('NotSupportedError'); + }, 'createIIRFilter([1], [])').throw(DOMException, 'NotSupportedError'); should(function() { // There has to be at least one coefficient. context.createIIRFilter([], [1]); - }, 'createIIRFilter([], [1])').throw('NotSupportedError'); + }, 'createIIRFilter([], [1])').throw(DOMException, 'NotSupportedError'); should( function() { @@ -96,7 +96,7 @@ context.createIIRFilter(coef, [1]); }, 'createIIRFilter(new Float32Array(21), [1])') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); should( function() { @@ -106,7 +106,7 @@ context.createIIRFilter([1], coef); }, 'createIIRFilter([1], new Float32Array(21))') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); should( function() { @@ -114,7 +114,7 @@ context.createIIRFilter([1], new Float32Array(2)); }, 'createIIRFilter([1], new Float32Array(2))') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); should( function() { @@ -122,7 +122,7 @@ context.createIIRFilter(new Float32Array(10), [1]); }, 'createIIRFilter(new Float32Array(10), [1])') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); should(function() { // Feedback coefficients must be finite. @@ -183,7 +183,7 @@ new Float32Array(20)); }, 'getFrequencyResponse(new Float32Array(10), new Float32Array(1), new Float32Array(20))') - .throw('InvalidAccessError'); + .throw(DOMException, 'InvalidAccessError'); should( function() { @@ -193,7 +193,7 @@ new Float32Array(1)); }, 'getFrequencyResponse(new Float32Array(10), new Float32Array(20), new Float32Array(1))') - .throw('InvalidAccessError'); + .throw(DOMException, 'InvalidAccessError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html b/testing/web-platform/tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html index f480ec8ce51f9..4b6863103622c 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html @@ -129,7 +129,7 @@ new OfflineAudioContext(options); }, 'new OfflineAudioContext(' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); // length cannot be 0 options = {length: 0, sampleRate: 8000}; @@ -138,7 +138,7 @@ new OfflineAudioContext(options); }, 'new OfflineAudioContext(' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); // sampleRate outside valid range options = {length: 1, sampleRate: 1}; @@ -147,7 +147,7 @@ new OfflineAudioContext(options); }, 'new OfflineAudioContext(' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); task.done(); }); diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html b/testing/web-platform/tests/webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html index aaf77aec555b7..36bf604b296c6 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-oscillatornode-interface/ctor-oscillator.html @@ -87,7 +87,7 @@ node = new OscillatorNode(context, options); }, 'new OscillatorNode(c, ' + JSON.stringify(options) + ')') - .throw('InvalidStateError'); + .throw(DOMException, 'InvalidStateError'); options = { type: 'custom', diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html b/testing/web-platform/tests/webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html index 5475a6210b724..98a171ad059ea 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-pannernode-interface/ctor-panner.html @@ -107,7 +107,7 @@ node = new PannerNode(context, options); }, 'new PannerNode(c, ' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); options = {channelCount: 3}; should( @@ -115,7 +115,7 @@ node = new PannerNode(context, options); }, 'new PannerNode(c, ' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); options = {channelCount: 99}; should( @@ -123,7 +123,7 @@ node = new PannerNode(context, options); }, 'new PannerNode(c, ' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); // Test channelCountMode. A mode of "max" is illegal, but others are // ok. @@ -153,7 +153,7 @@ node = new PannerNode(context, options); }, 'new PannerNode(c, ' + JSON.stringify(options) + ')') - .throw('NotSupportedError'); + .throw(DOMException, 'NotSupportedError'); options = {channelCountMode: 'foobar'}; should( diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html b/testing/web-platform/tests/webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html index caa99aa4031a2..9409f1ffce211 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-stereopanner-interface/ctor-stereopanner.html @@ -80,17 +80,23 @@ entry.tests.forEach(testItem => { let options = {}; options[entry.attribute] = testItem.value; - let method = testItem.error ? 'throw' : 'notThrow'; - - should( - () => { - node = new StereoPannerNode(context, options); - }, - `new StereoPannerNode(c, ${JSON.stringify(options)})`)[method]( - testItem.error); - if (!testItem.error) + + const testFunction = () => { + node = new StereoPannerNode(context, options); + }; + const testDescription = + `new StereoPannerNode(c, ${JSON.stringify(options)})`; + + if (testItem.error) { + testItem.error === TypeError + ? should(testFunction, testDescription).throw(TypeError) + : should(testFunction, testDescription) + .throw(DOMException, 'NotSupportedError'); + } else { + should(testFunction, testDescription).notThrow(); should(node[entry.attribute], `node.${entry.attribute}`) .beEqualTo(options[entry.attribute]); + } }); });