haikuwebkit/LayoutTests/webaudio/construct-node-with-closed-...

50 lines
2.9 KiB
Plaintext
Raw Permalink Normal View History

Constructing an AudioNode for a closed context should not throw an exception https://bugs.webkit.org/show_bug.cgi?id=216994 Reviewed by Darin Adler. Source/WebCore: Constructing an AudioNode for a closed context should not throw an exception. This behavior is not as per specification and does not match the behavior of Chrome & Firefox either. Test: webaudio/construct-node-with-closed-context.html * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::create): * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::lazyInitialize): (WebCore::BaseAudioContext::sampleRate const): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::create): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::create): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::create): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::create): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::create): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::create): * Modules/webaudio/IIRFilterNode.cpp: (WebCore::IIRFilterNode::create): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::create): * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::create): * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::create): LayoutTests: * http/wpt/webaudio/audiocontext-stopped-expected.txt: Removed. * http/wpt/webaudio/audiocontext-stopped.html: Removed. Drop outdated test. It is replaced with the new test I am introducing. * webaudio/MediaStreamAudioDestination/create-in-destroyed-context-expected.txt: Rebaseline Blink-imported test that is now passing. * webaudio/construct-node-with-closed-context-expected.txt: Added. * webaudio/construct-node-with-closed-context.html: Added. Add layout test coverage. Canonical link: https://commits.webkit.org/229800@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-26 22:13:56 +00:00
Makes sure that we don't throw an exception when constructing an AudioNode with a closed context.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS new AnalyserNode(context) did not throw exception.
PASS new AudioBufferSourceNode(context) did not throw exception.
PASS new BiquadFilterNode(context) did not throw exception.
PASS new ChannelMergerNode(context) did not throw exception.
PASS new ChannelSplitterNode(context) did not throw exception.
PASS new ConstantSourceNode(context) did not throw exception.
PASS new ConvolverNode(context) did not throw exception.
PASS new DelayNode(context) did not throw exception.
PASS new DynamicsCompressorNode(context) did not throw exception.
PASS new GainNode(context) did not throw exception.
PASS new IIRFilterNode(context, { feedforward: [1], feedback: [1, -0.9] }) did not throw exception.
PASS new MediaElementAudioSourceNode(context, { mediaElement: new Audio }) did not throw exception.
PASS new MediaStreamAudioDestinationNode(context) threw exception NotAllowedError: Cannot create a MediaStreamAudioDestinationNode in a detached frame.
PASS new OscillatorNode(context) did not throw exception.
PASS new PannerNode(context) did not throw exception.
PASS new PeriodicWave(context) did not throw exception.
PASS new StereoPannerNode(context) did not throw exception.
PASS new WaveShaperNode(context) did not throw exception.
PASS context.createAnalyser() did not throw exception.
PASS context.createBufferSource() did not throw exception.
PASS context.createBiquadFilter() did not throw exception.
PASS context.createChannelMerger() did not throw exception.
PASS context.createChannelSplitter() did not throw exception.
PASS context.createConstantSource() did not throw exception.
PASS context.createConvolver() did not throw exception.
PASS context.createDelay() did not throw exception.
PASS context.createDynamicsCompressor() did not throw exception.
PASS context.createGain() did not throw exception.
PASS context.createIIRFilter([1], [1, -0.9]) did not throw exception.
PASS context.createMediaElementSource(new Audio) did not throw exception.
PASS context.createMediaStreamDestination() threw exception NotAllowedError: Cannot create a MediaStreamAudioDestinationNode in a detached frame.
PASS context.createOscillator() did not throw exception.
PASS context.createPanner() did not throw exception.
PASS context.createPeriodicWave([1, 2], [1, 2]) did not throw exception.
PASS context.createStereoPanner() did not throw exception.
PASS context.createWaveShaper() did not throw exception.
PASS context.createScriptProcessor() did not throw exception.
PASS context.suspend() rejected promise with InvalidStateError: Context is closed.
PASS context.resume() rejected promise with InvalidStateError: Context is closed.
Constructing an AudioNode for a closed context should not throw an exception https://bugs.webkit.org/show_bug.cgi?id=216994 Reviewed by Darin Adler. Source/WebCore: Constructing an AudioNode for a closed context should not throw an exception. This behavior is not as per specification and does not match the behavior of Chrome & Firefox either. Test: webaudio/construct-node-with-closed-context.html * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::create): * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::lazyInitialize): (WebCore::BaseAudioContext::sampleRate const): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::create): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::create): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::create): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::create): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::create): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::create): * Modules/webaudio/IIRFilterNode.cpp: (WebCore::IIRFilterNode::create): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::create): * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::create): * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::create): LayoutTests: * http/wpt/webaudio/audiocontext-stopped-expected.txt: Removed. * http/wpt/webaudio/audiocontext-stopped.html: Removed. Drop outdated test. It is replaced with the new test I am introducing. * webaudio/MediaStreamAudioDestination/create-in-destroyed-context-expected.txt: Rebaseline Blink-imported test that is now passing. * webaudio/construct-node-with-closed-context-expected.txt: Added. * webaudio/construct-node-with-closed-context.html: Added. Add layout test coverage. Canonical link: https://commits.webkit.org/229800@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-26 22:13:56 +00:00
PASS context.close() rejected promise with InvalidStateError: The object is in an invalid state..
PASS successfullyParsed is true
TEST COMPLETE