Changeset 268812 in webkit
- Timestamp:
- Oct 21, 2020 11:38:48 AM (21 months ago)
- Location:
- trunk
- Files:
-
- 22 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-channels-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-delaynode-interface/delaynode-maxdelaylimit-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/Oscillator/oscillator-basic-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/ScriptProcessor/scriptprocessornode-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/convolver-channels-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/convolver-setBuffer-different-samplerate-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/delaynode-maxdelaylimit-expected.txt (modified) (1 diff)
-
LayoutTests/webaudio/dom-exceptions-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioContext.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp (modified) (2 diffs)
-
Source/WebCore/Modules/webaudio/BaseAudioContext.cpp (modified) (5 diffs)
-
Source/WebCore/Modules/webaudio/ConvolverNode.cpp (modified) (2 diffs)
-
Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/DelayNode.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r268810 r268812 1 2020-10-21 Chris Dumez <cdumez@apple.com> 2 3 Make sure WebAudio API throws exceptions with useful error messages 4 https://bugs.webkit.org/show_bug.cgi?id=218033 5 6 Reviewed by Darin Adler. 7 8 Rebaseline existing tests now that exception messages have been improved. 9 10 * webaudio/Oscillator/oscillator-basic-expected.txt: 11 * webaudio/ScriptProcessor/scriptprocessornode-expected.txt: 12 * webaudio/convolver-channels-expected.txt: 13 * webaudio/convolver-setBuffer-different-samplerate-expected.txt: 14 * webaudio/delaynode-maxdelaylimit-expected.txt: 15 * webaudio/dom-exceptions-expected.txt: 16 1 17 2020-10-21 Antoine Quint <graouts@webkit.org> 2 18 -
trunk/LayoutTests/imported/w3c/ChangeLog
r268792 r268812 1 2020-10-21 Chris Dumez <cdumez@apple.com> 2 3 Make sure WebAudio API throws exceptions with useful error messages 4 https://bugs.webkit.org/show_bug.cgi?id=218033 5 6 Reviewed by Darin Adler. 7 8 Rebaseline existing tests now that exception messages have been improved. 9 10 * web-platform-tests/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic-expected.txt: 11 * web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-channels-expected.txt: 12 * web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver-expected.txt: 13 * web-platform-tests/webaudio/the-audio-api/the-delaynode-interface/delaynode-maxdelaylimit-expected.txt: 14 1 15 2020-10-20 Sergio Villar Senin <svillar@igalia.com> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic-expected.txt
r267649 r268812 37 37 PASS Calling stop() before start() threw InvalidStateError: "cannot call stop without calling start first.". 38 38 PASS start(-1) threw RangeError: "when value should be positive". 39 PASS Calling start() twice threw InvalidStateError: " The object is in an invalid state.".39 PASS Calling start() twice threw InvalidStateError: "Cannot call start() more than once". 40 40 PASS stop(-1) threw RangeError: "when value should be positive". 41 41 PASS stop(NaN) threw TypeError: "The provided value is non-finite". -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-channels-expected.txt
r267649 r268812 6 6 PASS ConvolverNode with buffer of 1 channels did not throw an exception. 7 7 PASS ConvolverNode with buffer of 2 channels did not throw an exception. 8 PASS ConvolverNode with buffer of 3 channels threw NotSupportedError: " The operation is not supported.".8 PASS ConvolverNode with buffer of 3 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 9 9 PASS ConvolverNode with buffer of 4 channels did not throw an exception. 10 PASS ConvolverNode with buffer of 5 channels threw NotSupportedError: " The operation is not supported.".11 PASS ConvolverNode with buffer of 6 channels threw NotSupportedError: " The operation is not supported.".12 PASS ConvolverNode with buffer of 7 channels threw NotSupportedError: " The operation is not supported.".13 PASS ConvolverNode with buffer of 8 channels threw NotSupportedError: " The operation is not supported.".14 PASS ConvolverNode with buffer of 9 channels threw NotSupportedError: " The operation is not supported.".15 PASS ConvolverNode with buffer of 10 channels threw NotSupportedError: " The operation is not supported.".16 PASS ConvolverNode with buffer of 11 channels threw NotSupportedError: " The operation is not supported.".17 PASS ConvolverNode with buffer of 12 channels threw NotSupportedError: " The operation is not supported.".18 PASS ConvolverNode with buffer of 13 channels threw NotSupportedError: " The operation is not supported.".19 PASS ConvolverNode with buffer of 14 channels threw NotSupportedError: " The operation is not supported.".20 PASS ConvolverNode with buffer of 15 channels threw NotSupportedError: " The operation is not supported.".21 PASS ConvolverNode with buffer of 16 channels threw NotSupportedError: " The operation is not supported.".22 PASS ConvolverNode with buffer of 17 channels threw NotSupportedError: " The operation is not supported.".23 PASS ConvolverNode with buffer of 18 channels threw NotSupportedError: " The operation is not supported.".24 PASS ConvolverNode with buffer of 19 channels threw NotSupportedError: " The operation is not supported.".25 PASS ConvolverNode with buffer of 20 channels threw NotSupportedError: " The operation is not supported.".26 PASS ConvolverNode with buffer of 21 channels threw NotSupportedError: " The operation is not supported.".27 PASS ConvolverNode with buffer of 22 channels threw NotSupportedError: " The operation is not supported.".28 PASS ConvolverNode with buffer of 23 channels threw NotSupportedError: " The operation is not supported.".29 PASS ConvolverNode with buffer of 24 channels threw NotSupportedError: " The operation is not supported.".30 PASS ConvolverNode with buffer of 25 channels threw NotSupportedError: " The operation is not supported.".31 PASS ConvolverNode with buffer of 26 channels threw NotSupportedError: " The operation is not supported.".32 PASS ConvolverNode with buffer of 27 channels threw NotSupportedError: " The operation is not supported.".33 PASS ConvolverNode with buffer of 28 channels threw NotSupportedError: " The operation is not supported.".34 PASS ConvolverNode with buffer of 29 channels threw NotSupportedError: " The operation is not supported.".35 PASS ConvolverNode with buffer of 30 channels threw NotSupportedError: " The operation is not supported.".36 PASS ConvolverNode with buffer of 31 channels threw NotSupportedError: " The operation is not supported.".37 PASS ConvolverNode with buffer of 32 channels threw NotSupportedError: " The operation is not supported.".10 PASS ConvolverNode with buffer of 5 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 11 PASS ConvolverNode with buffer of 6 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 12 PASS ConvolverNode with buffer of 7 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 13 PASS ConvolverNode with buffer of 8 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 14 PASS ConvolverNode with buffer of 9 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 15 PASS ConvolverNode with buffer of 10 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 16 PASS ConvolverNode with buffer of 11 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 17 PASS ConvolverNode with buffer of 12 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 18 PASS ConvolverNode with buffer of 13 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 19 PASS ConvolverNode with buffer of 14 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 20 PASS ConvolverNode with buffer of 15 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 21 PASS ConvolverNode with buffer of 16 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 22 PASS ConvolverNode with buffer of 17 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 23 PASS ConvolverNode with buffer of 18 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 24 PASS ConvolverNode with buffer of 19 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 25 PASS ConvolverNode with buffer of 20 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 26 PASS ConvolverNode with buffer of 21 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 27 PASS ConvolverNode with buffer of 22 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 28 PASS ConvolverNode with buffer of 23 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 29 PASS ConvolverNode with buffer of 24 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 30 PASS ConvolverNode with buffer of 25 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 31 PASS ConvolverNode with buffer of 26 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 32 PASS ConvolverNode with buffer of 27 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 33 PASS ConvolverNode with buffer of 28 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 34 PASS ConvolverNode with buffer of 29 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 35 PASS ConvolverNode with buffer of 30 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 36 PASS ConvolverNode with buffer of 31 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 37 PASS ConvolverNode with buffer of 32 channels threw NotSupportedError: "Buffer should have 1, 2 or 4 channels". 38 38 PASS < [channel-count-test] All assertions passed. (total 32 assertions) 39 39 PASS # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully. -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/ctor-convolver-expected.txt
r267649 r268812 53 53 PASS < [nullable buffer] All assertions passed. (total 2 assertions) 54 54 PASS > [illegal sample-rate] 55 PASS node1 = new ConvolverNode(c, {"buffer":{}} threw NotSupportedError: " The operation is not supported.".55 PASS node1 = new ConvolverNode(c, {"buffer":{}} threw NotSupportedError: "Buffer sample rate does not match the context's sample rate". 56 56 PASS < [illegal sample-rate] All assertions passed. (total 1 assertions) 57 57 PASS > [construct with options] -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-delaynode-interface/delaynode-maxdelaylimit-expected.txt
r267649 r268812 4 4 PASS Audit report 5 5 PASS > [test] Tests attribute and maximum allowed delay of DelayNode 6 PASS Setting Delay length to 180 seconds or more threw NotSupportedError: " The operation is not supported.".7 PASS Setting Delay length to 0 seconds threw NotSupportedError: " The operation is not supported.".8 PASS Setting Delay length to negative threw NotSupportedError: " The operation is not supported.".6 PASS Setting Delay length to 180 seconds or more threw NotSupportedError: "maxDelayTime should be less than 180". 7 PASS Setting Delay length to 0 seconds threw NotSupportedError: "maxDelayTime should be a positive value". 8 PASS Setting Delay length to negative threw NotSupportedError: "maxDelayTime should be a positive value". 9 9 PASS Setting Delay length to NaN threw TypeError: "The provided value is non-finite". 10 10 PASS delay.delayTime.value = 0.5 is equal to 0.5. -
trunk/LayoutTests/webaudio/Oscillator/oscillator-basic-expected.txt
r267644 r268812 21 21 PASS Calling stop() before start() threw InvalidStateError: "cannot call stop without calling start first.". 22 22 PASS start(-1) threw RangeError: "when value should be positive". 23 PASS Calling start() twice threw InvalidStateError: " The object is in an invalid state.".23 PASS Calling start() twice threw InvalidStateError: "Cannot call start() more than once". 24 24 PASS stop(-1) threw RangeError: "when value should be positive". 25 25 PASS stop(NaN) threw TypeError: "The provided value is non-finite". -
trunk/LayoutTests/webaudio/ScriptProcessor/scriptprocessornode-expected.txt
r267644 r268812 4 4 PASS Audit report 5 5 PASS > [test] Basic ScriptProcessorNode properties 6 PASS createScriptProcessor(512, 0, 0) threw NotSupportedError: " The operation is not supported.".6 PASS createScriptProcessor(512, 0, 0) threw NotSupportedError: "numberOfInputChannels and numberOfOutputChannels cannot both be 0". 7 7 PASS context.createScriptProcessor(512, 1, 0) did not throw an exception. 8 8 PASS context.createScriptProcessor(512, 2, 0) did not throw an exception. 9 9 PASS context.createScriptProcessor(512, 0, 1) did not throw an exception. 10 10 PASS context.createScriptProcessor(512, 0, 2) did not throw an exception. 11 PASS context.createScriptProcessor(511, 1, 1) threw IndexSizeError: " The index is not in the allowed range.".11 PASS context.createScriptProcessor(511, 1, 1) threw IndexSizeError: "Unsupported buffer size for ScriptProcessorNode". 12 12 PASS context.createScriptProcessor(256, 1, 1) did not throw an exception. 13 13 PASS context.createScriptProcessor(512, 1, 1) did not throw an exception. -
trunk/LayoutTests/webaudio/convolver-channels-expected.txt
r219663 r268812 8 8 PASS function () { 9 9 convolver.buffer = buffer; 10 } threw exception NotSupportedError: The operation is not supported..10 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 11 11 PASS ConvolverNode with buffer of 4 channels did not throw exception. 12 12 PASS function () { 13 13 convolver.buffer = buffer; 14 } threw exception NotSupportedError: The operation is not supported..14 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 15 15 PASS function () { 16 16 convolver.buffer = buffer; 17 } threw exception NotSupportedError: The operation is not supported..17 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 18 18 PASS function () { 19 19 convolver.buffer = buffer; 20 } threw exception NotSupportedError: The operation is not supported..20 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 21 21 PASS function () { 22 22 convolver.buffer = buffer; 23 } threw exception NotSupportedError: The operation is not supported..23 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 24 24 PASS function () { 25 25 convolver.buffer = buffer; 26 } threw exception NotSupportedError: The operation is not supported..26 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 27 27 PASS function () { 28 28 convolver.buffer = buffer; 29 } threw exception NotSupportedError: The operation is not supported..29 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 30 30 PASS function () { 31 31 convolver.buffer = buffer; 32 } threw exception NotSupportedError: The operation is not supported..32 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 33 33 PASS function () { 34 34 convolver.buffer = buffer; 35 } threw exception NotSupportedError: The operation is not supported..35 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 36 36 PASS function () { 37 37 convolver.buffer = buffer; 38 } threw exception NotSupportedError: The operation is not supported..38 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 39 39 PASS function () { 40 40 convolver.buffer = buffer; 41 } threw exception NotSupportedError: The operation is not supported..41 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 42 42 PASS function () { 43 43 convolver.buffer = buffer; 44 } threw exception NotSupportedError: The operation is not supported..44 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 45 45 PASS function () { 46 46 convolver.buffer = buffer; 47 } threw exception NotSupportedError: The operation is not supported..47 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 48 48 PASS function () { 49 49 convolver.buffer = buffer; 50 } threw exception NotSupportedError: The operation is not supported..50 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 51 51 PASS function () { 52 52 convolver.buffer = buffer; 53 } threw exception NotSupportedError: The operation is not supported..53 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 54 54 PASS function () { 55 55 convolver.buffer = buffer; 56 } threw exception NotSupportedError: The operation is not supported..56 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 57 57 PASS function () { 58 58 convolver.buffer = buffer; 59 } threw exception NotSupportedError: The operation is not supported..59 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 60 60 PASS function () { 61 61 convolver.buffer = buffer; 62 } threw exception NotSupportedError: The operation is not supported..62 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 63 63 PASS function () { 64 64 convolver.buffer = buffer; 65 } threw exception NotSupportedError: The operation is not supported..65 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 66 66 PASS function () { 67 67 convolver.buffer = buffer; 68 } threw exception NotSupportedError: The operation is not supported..68 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 69 69 PASS function () { 70 70 convolver.buffer = buffer; 71 } threw exception NotSupportedError: The operation is not supported..71 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 72 72 PASS function () { 73 73 convolver.buffer = buffer; 74 } threw exception NotSupportedError: The operation is not supported..74 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 75 75 PASS function () { 76 76 convolver.buffer = buffer; 77 } threw exception NotSupportedError: The operation is not supported..77 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 78 78 PASS function () { 79 79 convolver.buffer = buffer; 80 } threw exception NotSupportedError: The operation is not supported..80 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 81 81 PASS function () { 82 82 convolver.buffer = buffer; 83 } threw exception NotSupportedError: The operation is not supported..83 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 84 84 PASS function () { 85 85 convolver.buffer = buffer; 86 } threw exception NotSupportedError: The operation is not supported..86 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 87 87 PASS function () { 88 88 convolver.buffer = buffer; 89 } threw exception NotSupportedError: The operation is not supported..89 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 90 90 PASS function () { 91 91 convolver.buffer = buffer; 92 } threw exception NotSupportedError: The operation is not supported..92 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 93 93 PASS function () { 94 94 convolver.buffer = buffer; 95 } threw exception NotSupportedError: The operation is not supported..95 } threw exception NotSupportedError: Buffer should have 1, 2 or 4 channels. 96 96 PASS successfullyParsed is true 97 97 -
trunk/LayoutTests/webaudio/convolver-setBuffer-different-samplerate-expected.txt
r219663 r268812 4 4 5 5 6 PASS convolver.buffer = context.createBuffer(1, 256, 22050) threw exception NotSupportedError: The operation is not supported..6 PASS convolver.buffer = context.createBuffer(1, 256, 22050) threw exception NotSupportedError: Buffer sample rate does not match the context's sample rate. 7 7 PASS convolver.buffer = context.createBuffer(1, 256, 44100) did not throw exception. 8 8 PASS successfullyParsed is true -
trunk/LayoutTests/webaudio/delaynode-maxdelaylimit-expected.txt
r219663 r268812 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 PASS context.createDelay(180) threw exception NotSupportedError: The operation is not supported..6 PASS context.createDelay(0) threw exception NotSupportedError: The operation is not supported..7 PASS context.createDelay(-1) threw exception NotSupportedError: The operation is not supported..5 PASS context.createDelay(180) threw exception NotSupportedError: maxDelayTime should be less than 180. 6 PASS context.createDelay(0) threw exception NotSupportedError: maxDelayTime should be a positive value. 7 PASS context.createDelay(-1) threw exception NotSupportedError: maxDelayTime should be a positive value. 8 8 PASS delay.delayTime.value === 0.5 is true 9 9 PASS Test signal was correctly delayed by 0.5 sec. -
trunk/LayoutTests/webaudio/dom-exceptions-expected.txt
r267644 r268812 50 50 PASS < [createMediaStreamSource] All assertions passed. (total 1 assertions) 51 51 PASS > [createScriptProcessor] 52 PASS context.createScriptProcessor(1, 1, 1) threw IndexSizeError: " The index is not in the allowed range.".53 PASS context.createScriptProcessor(4096, 100, 1) threw NotSupportedError: " The operation is not supported.".54 PASS context.createScriptProcessor(4096, 1, 100) threw NotSupportedError: " The operation is not supported.".52 PASS context.createScriptProcessor(1, 1, 1) threw IndexSizeError: "Unsupported buffer size for ScriptProcessorNode". 53 PASS context.createScriptProcessor(4096, 100, 1) threw NotSupportedError: "numberOfInputChannels exceeds maximum number of channels". 54 PASS context.createScriptProcessor(4096, 1, 100) threw NotSupportedError: "numberOfOutputChannels exceeds maximum number of channels". 55 55 PASS context.createScriptProcessor() did not throw an exception. 56 56 PASS context.createScriptProcessor(0) did not throw an exception. … … 223 223 PASS conv = oc.createConvolver() did not throw an exception. 224 224 PASS conv.buffer = {} threw TypeError: "The ConvolverNode.buffer attribute must be an instance of AudioBuffer". 225 PASS conv.buffer = oc.createBuffer(1, 100, 22050) threw NotSupportedError: " The operation is not supported.".225 PASS conv.buffer = oc.createBuffer(1, 100, 22050) threw NotSupportedError: "Buffer sample rate does not match the context's sample rate". 226 226 PASS conv.buffer is equal to null. 227 227 PASS < [convolver] All assertions passed. (total 5 assertions) -
trunk/Source/WebCore/ChangeLog
r268809 r268812 1 2020-10-21 Chris Dumez <cdumez@apple.com> 2 3 Make sure WebAudio API throws exceptions with useful error messages 4 https://bugs.webkit.org/show_bug.cgi?id=218033 5 6 Reviewed by Darin Adler. 7 8 Make sure WebAudio API throws exceptions with useful error messages to be 9 more developer friendly. 10 11 No new tests, rebaselined existing tests. 12 13 * Modules/webaudio/AudioContext.cpp: 14 (WebCore::AudioContext::create): 15 * Modules/webaudio/AudioScheduledSourceNode.cpp: 16 (WebCore::AudioScheduledSourceNode::startLater): 17 * Modules/webaudio/AudioWorkletGlobalScope.cpp: 18 (WebCore::AudioWorkletGlobalScope::registerProcessor): 19 * Modules/webaudio/BaseAudioContext.cpp: 20 (WebCore::BaseAudioContext::createScriptProcessor): 21 (WebCore::BaseAudioContext::finishedRendering): 22 * Modules/webaudio/ConvolverNode.cpp: 23 (WebCore::ConvolverNode::setBuffer): 24 * Modules/webaudio/DefaultAudioDestinationNode.cpp: 25 (WebCore::DefaultAudioDestinationNode::startRendering): 26 * Modules/webaudio/DelayNode.cpp: 27 (WebCore::DelayNode::create): 28 * Modules/webaudio/OfflineAudioContext.cpp: 29 (WebCore::OfflineAudioContext::create): 30 * Modules/webaudio/OfflineAudioDestinationNode.cpp: 31 (WebCore::OfflineAudioDestinationNode::startRendering): 32 1 33 2020-10-21 Antoine Quint <graouts@webkit.org> 2 34 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r268728 r268812 87 87 #if OS(WINDOWS) 88 88 if (s_hardwareContextCount >= maxHardwareContexts) 89 return Exception { QuotaExceededError };89 return Exception { QuotaExceededError, "Reached maximum number of hardware contexts on this platform"_s }; 90 90 #endif 91 91 -
trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp
r268728 r268812 154 154 155 155 if (m_playbackState != UNSCHEDULED_STATE) 156 return Exception { InvalidStateError };156 return Exception { InvalidStateError, "Cannot call start() more than once"_s }; 157 157 158 158 if (!std::isfinite(when) || when < 0) -
trunk/Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp
r268517 r268812 77 77 78 78 auto prototype = jsConstructor->getPrototype(vm, globalObject); 79 RETURN_IF_EXCEPTION(scope, Exception { TypeError });79 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 80 80 81 81 if (!prototype.isObject()) … … 83 83 84 84 auto parameterDescriptorsValue = jsConstructor->get(globalObject, JSC::Identifier::fromString(vm, "parameterDescriptors")); 85 RETURN_IF_EXCEPTION(scope, Exception { TypeError });85 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 86 86 87 87 Vector<AudioParamDescriptor> parameterDescriptors; 88 88 if (!parameterDescriptorsValue.isUndefined()) { 89 89 parameterDescriptors = convert<IDLSequence<IDLDictionary<AudioParamDescriptor>>>(*globalObject, parameterDescriptorsValue); 90 RETURN_IF_EXCEPTION(scope, Exception { TypeError });90 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 91 91 UNUSED_PARAM(parameterDescriptors); 92 92 HashSet<String> paramNames; -
trunk/Source/WebCore/Modules/webaudio/BaseAudioContext.cpp
r268728 r268812 415 415 break; 416 416 default: 417 return Exception { IndexSizeError };417 return Exception { IndexSizeError, "Unsupported buffer size for ScriptProcessorNode"_s }; 418 418 } 419 419 … … 423 423 424 424 if (!numberOfInputChannels && !numberOfOutputChannels) 425 return Exception { NotSupportedError };425 return Exception { NotSupportedError, "numberOfInputChannels and numberOfOutputChannels cannot both be 0"_s }; 426 426 427 427 // This parameter [numberOfInputChannels] determines the number of channels for this node's input. Values of … … 429 429 430 430 if (numberOfInputChannels > maxNumberOfChannels()) 431 return Exception { NotSupportedError };431 return Exception { NotSupportedError, "numberOfInputChannels exceeds maximum number of channels"_s }; 432 432 433 433 // This parameter [numberOfOutputChannels] determines the number of channels for this node's output. Values of … … 435 435 436 436 if (numberOfOutputChannels > maxNumberOfChannels()) 437 return Exception { NotSupportedError };437 return Exception { NotSupportedError, "numberOfOutputChannels exceeds maximum number of channels"_s }; 438 438 439 439 return ScriptProcessorNode::create(*this, bufferSize, numberOfInputChannels, numberOfOutputChannels); … … 926 926 ASSERT(isMainThread()); 927 927 auto finishedRenderingScope = WTF::makeScopeExit([this] { 928 didFinishOfflineRendering(Exception { InvalidStateError });928 didFinishOfflineRendering(Exception { InvalidStateError, "Offline rendering failed"_s }); 929 929 }); 930 930 -
trunk/Source/WebCore/Modules/webaudio/ConvolverNode.cpp
r268001 r268812 119 119 120 120 if (buffer->sampleRate() != context().sampleRate()) 121 return Exception { NotSupportedError };121 return Exception { NotSupportedError, "Buffer sample rate does not match the context's sample rate"_s }; 122 122 123 123 unsigned numberOfChannels = buffer->numberOfChannels(); … … 126 126 // The current implementation supports only 1-, 2-, or 4-channel impulse responses, with the 127 127 // 4-channel response being interpreted as true-stereo (see Reverb class). 128 bool isChannelCountGood = (numberOfChannels == 1 || numberOfChannels == 2 || numberOfChannels == 4) && bufferLength;128 bool isChannelCountGood = (numberOfChannels == 1 || numberOfChannels == 2 || numberOfChannels == 4); 129 129 130 130 if (!isChannelCountGood) 131 return Exception { NotSupportedError }; 131 return Exception { NotSupportedError, "Buffer should have 1, 2 or 4 channels"_s }; 132 133 if (!bufferLength) 134 return Exception { NotSupportedError, "Buffer length cannot be 0"_s }; 132 135 133 136 // Wrap the AudioBuffer by an AudioBus. It's an efficient pointer set and not a memcpy(). -
trunk/Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp
r267859 r268812 124 124 ASSERT(isInitialized()); 125 125 if (!isInitialized()) 126 return Exception { InvalidStateError };126 return Exception { InvalidStateError, "AudioDestinationNode is not initialized"_s }; 127 127 128 128 m_destination->start(dispatchToRenderThreadFunction()); -
trunk/Source/WebCore/Modules/webaudio/DelayNode.cpp
r267639 r268812 50 50 ExceptionOr<Ref<DelayNode>> DelayNode::create(BaseAudioContext& context, const DelayOptions& options) 51 51 { 52 if (options.maxDelayTime <= 0 || options.maxDelayTime >= maximumAllowedDelayTime) 53 return Exception { NotSupportedError }; 52 if (options.maxDelayTime <= 0) 53 return Exception { NotSupportedError, "maxDelayTime should be a positive value"_s }; 54 55 if (options.maxDelayTime >= maximumAllowedDelayTime) 56 return Exception { NotSupportedError, makeString("maxDelayTime should be less than ", maximumAllowedDelayTime) }; 54 57 55 58 auto delayNode = adoptRef(*new DelayNode(context, options.maxDelayTime)); -
trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp
r268600 r268812 46 46 ExceptionOr<Ref<OfflineAudioContext>> OfflineAudioContext::create(ScriptExecutionContext& context, unsigned numberOfChannels, size_t length, float sampleRate) 47 47 { 48 // FIXME: Add support for workers.49 48 if (!is<Document>(context)) 50 return Exception { NotSupportedError };49 return Exception { NotSupportedError, "OfflineAudioContext is only supported in Document contexts"_s }; 51 50 if (!numberOfChannels || numberOfChannels > maxNumberOfChannels()) 52 51 return Exception { SyntaxError, "Number of channels is not in range"_s }; -
trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp
r267859 r268812 92 92 ASSERT(m_renderTarget.get()); 93 93 if (!m_renderTarget.get()) 94 return Exception { InvalidStateError };94 return Exception { InvalidStateError, "OfflineAudioContextNode has no rendering buffer"_s }; 95 95 96 96 if (m_startedRendering)
Note: See TracChangeset
for help on using the changeset viewer.