haikuwebkit/LayoutTests/webaudio/audiobuffersource-channels-...

24 lines
966 B
Plaintext
Raw Permalink Normal View History

Tests that AudioBufferSourceNode validates AudioBuffer in .buffer attribute setter.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
AudioBufferSourceNode.buffer should be nullable https://bugs.webkit.org/show_bug.cgi?id=156769 Reviewed by Darin Adler. Source/WebCore: AudioBufferSourceNode.buffer should be nullable as per the specification: https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode Our implementation was initially returning null when getting AudioBufferSourceNode.buffer, which is correct. However, it would throw a TypeError when trying to set the attribute to null. Our implementation setter actually supported setting the buffer to null but the custom bindings for the setter would not. This patch does the following: - Get rid of the custom bindings for the AudioBufferSourceNode.buffer setter. We can have the bindings generator generate the same code by using [StrictTypeChecking]. The custom bindinds were also throwing a TypeError if the input AudioBuffer had too many channels but this does not seem to be possible. - Mark AudioBufferSourceNode.buffer as nullable in the IDL so that we no longer throw when the JS tries to assign null, but instead calls AudioBufferSourceNode::setBuffer(nullptr) No new test, updated webaudio/audiobuffersource-channels.html * CMakeLists.txt: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::setBuffer): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.h: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSAudioBufferSourceNodeCustom.cpp: Removed. LayoutTests: Update existing layout test to check that: - AudioBufferSourceNode.buffer is initially null - AudioBufferSourceNode.buffer can be set to null - We cannot create an AudioBuffer that has too many channels * webaudio/audiobuffersource-channels-expected.txt: * webaudio/audiobuffersource-channels.html: Canonical link: https://commits.webkit.org/174886@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-20 01:30:11 +00:00
PASS source.buffer is null
Turn off the legacy prefixed WebAudio API https://bugs.webkit.org/show_bug.cgi?id=216886 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/webaudio/historical-expected.txt: Rebaseline test that is now passing. Source/WebCore: Turn off the legacy prefixed WebAudio API, now that the modern unprefixed API has been enabled in r267488. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBufferSourceNode.idl: Make sure legacy constants get unexposed if the PrefixedWebAudio setting is disabled. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GetRuntimeEnabledStaticProperties): * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: (WebCore::JSTestConditionalIncludesConstructor::initializeProperties): (WebCore::JSTestConditionalIncludesPrototype::finishCreation): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingConstructor::prototypeForStructure): (WebCore::JSTestEnabledBySettingConstructor::initializeProperties): (WebCore::JSTestEnabledBySettingPrototype::finishCreation): * bindings/scripts/test/TestEnabledBySetting.idl: Add support for using [EnabledBySetting=X] on constants. Source/WebKit: Turn off the legacy prefixed WebAudio API, now that the modern unprefixed API has been enabled in r267488. * Shared/WebPreferencesInternal.yaml: Source/WebKitLegacy/mac: Turn off the legacy prefixed WebAudio API, now that the modern unprefixed API has been enabled in r267488. * WebView/WebView.mm: (-[WebView _preferencesChanged:]): LayoutTests: Port existing layout tests from the prefixed WebAudio API to the new unprefixed version. * fast/history/page-cache-closed-audiocontext.html: * fast/history/page-cache-running-audiocontext.html: * fast/history/page-cache-suspended-audiocontext.html: * fast/mediastream/getUserMedia-webaudio.html: * fast/mediastream/media-devices-enumerate-devices.html: * fast/mediastream/mediastreamtrack-audio-clone.html: * fast/mediastream/mock-media-source-webaudio.html: * http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html: * http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html: * http/wpt/mediarecorder/MediaRecorder-onremovetrack.html: * http/wpt/webaudio/resources/audiocontext-stopped-iframe.html: * platform/ios/webaudio/realtimeanalyser-fft-sizing-expected.txt: * resources/testharnessreport.js: * webaudio/analyser-exception.html: * webaudio/audiobuffer-crash-expected.txt: * webaudio/audiobuffer-crash.html: * webaudio/audiobuffer-expected.txt: * webaudio/audiobuffer-neuter.html: * webaudio/audiobuffer.html: * webaudio/audiobuffersource-channels-expected.txt: * webaudio/audiobuffersource-channels.html: * webaudio/audiobuffersource-ended.html: * webaudio/audiobuffersource-multi-channels.html: * webaudio/audiobuffersource-negative-playbackrate-interpolated-loop.html: * webaudio/audiobuffersource-negative-playbackrate-interpolated.html: * webaudio/audiobuffersource-negative-playbackrate-loop.html: * webaudio/audiobuffersource-negative-playbackrate.html: * webaudio/audiobuffersource-not-gced-until-ended.html: * webaudio/audiobuffersource-playbackState-expected.txt: Removed. * webaudio/audiobuffersource-playbackState.html: Removed. * webaudio/audiobuffersource-playbackrate.html: * webaudio/audiobuffersource-start.html: * webaudio/audiobuffersource.html: * webaudio/audiobuffersourcenode-legacy-api-expected.txt: * webaudio/audiobuffersourcenode-legacy-api.html: * webaudio/audiochannelmerger-basic.html: * webaudio/audiochannelmerger-stereo.html: * webaudio/audiochannelsplitter.html: * webaudio/audiocontext-promise-throwing-expected.txt: * webaudio/audiocontext-promise-throwing.html: * webaudio/audiocontext-promise.html: * webaudio/audiocontext-restriction-audiobuffersourcenode-start.html: * webaudio/audiocontext-restriction.html: * webaudio/audiocontext-state-interrupted.html: * webaudio/audiocontext-state.html: * webaudio/audionode-connect-order.html: * webaudio/audionode.html: * webaudio/audioparam-connect-audioratesignal.html: * webaudio/audioparam-summingjunction.html: * webaudio/audioprocessingevent.html: * webaudio/automatic-pull-node.html: * webaudio/convolution-mono-mono.html: * webaudio/convolver-channels.html: * webaudio/convolver-setBuffer-different-samplerate.html: * webaudio/convolver-setBuffer-null.html: * webaudio/createMediaStreamSource-null-expected.txt: * webaudio/createMediaStreamSource-null.html: * webaudio/decode-audio-data-basic-expected.txt: * webaudio/decode-audio-data-basic.html: * webaudio/decode-audio-data-too-short.html: * webaudio/delaynode-max-default-delay.html: * webaudio/delaynode-max-nondefault-delay.html: * webaudio/delaynode-maxdelay.html: * webaudio/delaynode-maxdelaylimit.html: * webaudio/delaynode-scheduling.html: * webaudio/delaynode.html: * webaudio/distance-exponential.html: * webaudio/distance-inverse.html: * webaudio/distance-linear.html: * webaudio/dynamicscompressor-basic.html: * webaudio/finished-audio-buffer-source-nodes-should-be-collectable.html: * webaudio/gain-basic.html: * webaudio/gain.html: * webaudio/mediaelementaudiosourcenode-expected.txt: * webaudio/mediaelementaudiosourcenode-gc.html: * webaudio/mediaelementaudiosourcenode.html: * webaudio/mixing.html: * webaudio/offlineaudiocontext-gc.html: * webaudio/offlineaudiocontext-restriction.html: * webaudio/oscillatornode-legacy-api-expected.txt: * webaudio/oscillatornode-legacy-api.html: * webaudio/page-canstartmedia.html: * webaudio/panner-equalpower-stereo.html: * webaudio/panner-equalpower.html: * webaudio/prefixed-pannernode-basic-expected.txt: Removed. * webaudio/prefixed-pannernode-basic.html: Removed. * webaudio/realtimeanalyser-fft-sizing-expected.txt: * webaudio/realtimeanalyser-fft-sizing.html: * webaudio/resources/audio-codec-test.js: (runDecodingTest): * webaudio/resources/audiobuffersource-ended-detached-frame-iframe.html: * webaudio/resources/audioparam-testing-legacy.js: (createAudioGraphAndTest): * webaudio/resources/compatibility.js: Removed. * webaudio/resources/javascriptaudionode-testing.js: (runJSNodeTest): * webaudio/resources/oscillator-testing-legacy.js: (generateExponentialOscillatorSweep): * webaudio/sample-accurate-scheduling.html: * webaudio/silence-after-playback.html: * webaudio/silent-audio-interrupted-in-background.html: * webaudio/stereo2mono-down-mixing.html: * webaudio/test-basic.html: * webaudio/up-mixing-mono-51.html: * webaudio/up-mixing-mono-stereo.html: * webaudio/up-mixing-stereo-51.html: * webaudio/waveshaper.html: * webaudio/web-audio-is-playing.html: * webaudio/webaudio-gc.html: * webaudio/webkitofflineaudiocontext-startRendering-crash-expected.txt: * webaudio/webkitofflineaudiocontext-startRendering-crash.html: * webrtc/audio-peer-connection-g722.html: * webrtc/audio-peer-connection-webaudio.html: * webrtc/clone-audio-track.html: * webrtc/getUserMedia-webaudio-autoplay.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-createMediaStreamDestination.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: Canonical link: https://commits.webkit.org/229688@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-23 22:48:05 +00:00
PASS source.buffer = 57 threw exception TypeError: The AudioBufferSourceNode.buffer attribute must be an instance of AudioBuffer.
PASS Mono buffer can be set.
Turn off the legacy prefixed WebAudio API https://bugs.webkit.org/show_bug.cgi?id=216886 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/webaudio/historical-expected.txt: Rebaseline test that is now passing. Source/WebCore: Turn off the legacy prefixed WebAudio API, now that the modern unprefixed API has been enabled in r267488. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBufferSourceNode.idl: Make sure legacy constants get unexposed if the PrefixedWebAudio setting is disabled. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GetRuntimeEnabledStaticProperties): * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: (WebCore::JSTestConditionalIncludesConstructor::initializeProperties): (WebCore::JSTestConditionalIncludesPrototype::finishCreation): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingConstructor::prototypeForStructure): (WebCore::JSTestEnabledBySettingConstructor::initializeProperties): (WebCore::JSTestEnabledBySettingPrototype::finishCreation): * bindings/scripts/test/TestEnabledBySetting.idl: Add support for using [EnabledBySetting=X] on constants. Source/WebKit: Turn off the legacy prefixed WebAudio API, now that the modern unprefixed API has been enabled in r267488. * Shared/WebPreferencesInternal.yaml: Source/WebKitLegacy/mac: Turn off the legacy prefixed WebAudio API, now that the modern unprefixed API has been enabled in r267488. * WebView/WebView.mm: (-[WebView _preferencesChanged:]): LayoutTests: Port existing layout tests from the prefixed WebAudio API to the new unprefixed version. * fast/history/page-cache-closed-audiocontext.html: * fast/history/page-cache-running-audiocontext.html: * fast/history/page-cache-suspended-audiocontext.html: * fast/mediastream/getUserMedia-webaudio.html: * fast/mediastream/media-devices-enumerate-devices.html: * fast/mediastream/mediastreamtrack-audio-clone.html: * fast/mediastream/mock-media-source-webaudio.html: * http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html: * http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html: * http/wpt/mediarecorder/MediaRecorder-onremovetrack.html: * http/wpt/webaudio/resources/audiocontext-stopped-iframe.html: * platform/ios/webaudio/realtimeanalyser-fft-sizing-expected.txt: * resources/testharnessreport.js: * webaudio/analyser-exception.html: * webaudio/audiobuffer-crash-expected.txt: * webaudio/audiobuffer-crash.html: * webaudio/audiobuffer-expected.txt: * webaudio/audiobuffer-neuter.html: * webaudio/audiobuffer.html: * webaudio/audiobuffersource-channels-expected.txt: * webaudio/audiobuffersource-channels.html: * webaudio/audiobuffersource-ended.html: * webaudio/audiobuffersource-multi-channels.html: * webaudio/audiobuffersource-negative-playbackrate-interpolated-loop.html: * webaudio/audiobuffersource-negative-playbackrate-interpolated.html: * webaudio/audiobuffersource-negative-playbackrate-loop.html: * webaudio/audiobuffersource-negative-playbackrate.html: * webaudio/audiobuffersource-not-gced-until-ended.html: * webaudio/audiobuffersource-playbackState-expected.txt: Removed. * webaudio/audiobuffersource-playbackState.html: Removed. * webaudio/audiobuffersource-playbackrate.html: * webaudio/audiobuffersource-start.html: * webaudio/audiobuffersource.html: * webaudio/audiobuffersourcenode-legacy-api-expected.txt: * webaudio/audiobuffersourcenode-legacy-api.html: * webaudio/audiochannelmerger-basic.html: * webaudio/audiochannelmerger-stereo.html: * webaudio/audiochannelsplitter.html: * webaudio/audiocontext-promise-throwing-expected.txt: * webaudio/audiocontext-promise-throwing.html: * webaudio/audiocontext-promise.html: * webaudio/audiocontext-restriction-audiobuffersourcenode-start.html: * webaudio/audiocontext-restriction.html: * webaudio/audiocontext-state-interrupted.html: * webaudio/audiocontext-state.html: * webaudio/audionode-connect-order.html: * webaudio/audionode.html: * webaudio/audioparam-connect-audioratesignal.html: * webaudio/audioparam-summingjunction.html: * webaudio/audioprocessingevent.html: * webaudio/automatic-pull-node.html: * webaudio/convolution-mono-mono.html: * webaudio/convolver-channels.html: * webaudio/convolver-setBuffer-different-samplerate.html: * webaudio/convolver-setBuffer-null.html: * webaudio/createMediaStreamSource-null-expected.txt: * webaudio/createMediaStreamSource-null.html: * webaudio/decode-audio-data-basic-expected.txt: * webaudio/decode-audio-data-basic.html: * webaudio/decode-audio-data-too-short.html: * webaudio/delaynode-max-default-delay.html: * webaudio/delaynode-max-nondefault-delay.html: * webaudio/delaynode-maxdelay.html: * webaudio/delaynode-maxdelaylimit.html: * webaudio/delaynode-scheduling.html: * webaudio/delaynode.html: * webaudio/distance-exponential.html: * webaudio/distance-inverse.html: * webaudio/distance-linear.html: * webaudio/dynamicscompressor-basic.html: * webaudio/finished-audio-buffer-source-nodes-should-be-collectable.html: * webaudio/gain-basic.html: * webaudio/gain.html: * webaudio/mediaelementaudiosourcenode-expected.txt: * webaudio/mediaelementaudiosourcenode-gc.html: * webaudio/mediaelementaudiosourcenode.html: * webaudio/mixing.html: * webaudio/offlineaudiocontext-gc.html: * webaudio/offlineaudiocontext-restriction.html: * webaudio/oscillatornode-legacy-api-expected.txt: * webaudio/oscillatornode-legacy-api.html: * webaudio/page-canstartmedia.html: * webaudio/panner-equalpower-stereo.html: * webaudio/panner-equalpower.html: * webaudio/prefixed-pannernode-basic-expected.txt: Removed. * webaudio/prefixed-pannernode-basic.html: Removed. * webaudio/realtimeanalyser-fft-sizing-expected.txt: * webaudio/realtimeanalyser-fft-sizing.html: * webaudio/resources/audio-codec-test.js: (runDecodingTest): * webaudio/resources/audiobuffersource-ended-detached-frame-iframe.html: * webaudio/resources/audioparam-testing-legacy.js: (createAudioGraphAndTest): * webaudio/resources/compatibility.js: Removed. * webaudio/resources/javascriptaudionode-testing.js: (runJSNodeTest): * webaudio/resources/oscillator-testing-legacy.js: (generateExponentialOscillatorSweep): * webaudio/sample-accurate-scheduling.html: * webaudio/silence-after-playback.html: * webaudio/silent-audio-interrupted-in-background.html: * webaudio/stereo2mono-down-mixing.html: * webaudio/test-basic.html: * webaudio/up-mixing-mono-51.html: * webaudio/up-mixing-mono-stereo.html: * webaudio/up-mixing-stereo-51.html: * webaudio/waveshaper.html: * webaudio/web-audio-is-playing.html: * webaudio/webaudio-gc.html: * webaudio/webkitofflineaudiocontext-startRendering-crash-expected.txt: * webaudio/webkitofflineaudiocontext-startRendering-crash.html: * webrtc/audio-peer-connection-g722.html: * webrtc/audio-peer-connection-webaudio.html: * webrtc/clone-audio-track.html: * webrtc/getUserMedia-webaudio-autoplay.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-createMediaStreamDestination.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: Canonical link: https://commits.webkit.org/229688@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-23 22:48:05 +00:00
PASS Stereo buffer can not be set.
PASS 3 channels buffer can not be set.
PASS 4 channels buffer can not be set.
PASS 5 channels buffer can not be set.
PASS 6 channels buffer can not be set.
PASS 7 channels buffer can not be set.
PASS 8 channels buffer can not be set.
PASS 9 channels buffer can not be set.
Added AudioBuffer Constructor https://bugs.webkit.org/show_bug.cgi?id=214990 Patch by Clark Wang <clark_wang@apple.com> on 2020-08-03 Reviewed by Chris Dumez. LayoutTests/imported/w3c: Re-baselined existing tests. Some now fail due to unsupported sampleRate. * web-platform-tests/webaudio/idlharness.https.window-expected.txt: * web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/ctor-audiobuffer-expected.txt: * web-platform-tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-channels-expected.txt: * web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/active-processing.https-expected.txt: * web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-response-1-chan-expected.txt: * web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-response-2-chan-expected.txt: * web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-response-4-chan-expected.txt: * web-platform-tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value-expected.txt: * web-platform-tests/webaudio/the-audio-api/the-oscillatornode-interface/osc-basic-waveform-expected.txt: Source/WebCore: Added AudioBuffer constructor according to spec: https://www.w3.org/TR/webaudio/#AudioBuffer-constructors. Added in AudioBufferOptions files. Updated BaseAudioContext::createBuffer to use new constructor. Re-baselined existing tests. Some fail now due to unsupported sampleRate. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::create): (WebCore::AudioBuffer::AudioBuffer): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferOptions.h: Added. * Modules/webaudio/AudioBufferOptions.idl: Added. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createBuffer): * Modules/webaudio/BaseAudioContext.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: LayoutTests: Re-baselined existing tests. Some now fail due to unsupported sampleRate. * TestExpectations: * webaudio/audiobuffer-crash-expected.txt: * webaudio/audiobuffersource-channels-expected.txt: Canonical link: https://commits.webkit.org/227896@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-03 19:22:58 +00:00
PASS context.createBuffer(64, 1024, context.sampleRate) threw exception NotSupportedError: Number of channels cannot be more than max supported..
AudioBufferSourceNode.buffer should be nullable https://bugs.webkit.org/show_bug.cgi?id=156769 Reviewed by Darin Adler. Source/WebCore: AudioBufferSourceNode.buffer should be nullable as per the specification: https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode Our implementation was initially returning null when getting AudioBufferSourceNode.buffer, which is correct. However, it would throw a TypeError when trying to set the attribute to null. Our implementation setter actually supported setting the buffer to null but the custom bindings for the setter would not. This patch does the following: - Get rid of the custom bindings for the AudioBufferSourceNode.buffer setter. We can have the bindings generator generate the same code by using [StrictTypeChecking]. The custom bindinds were also throwing a TypeError if the input AudioBuffer had too many channels but this does not seem to be possible. - Mark AudioBufferSourceNode.buffer as nullable in the IDL so that we no longer throw when the JS tries to assign null, but instead calls AudioBufferSourceNode::setBuffer(nullptr) No new test, updated webaudio/audiobuffersource-channels.html * CMakeLists.txt: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::setBuffer): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.h: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSAudioBufferSourceNodeCustom.cpp: Removed. LayoutTests: Update existing layout test to check that: - AudioBufferSourceNode.buffer is initially null - AudioBufferSourceNode.buffer can be set to null - We cannot create an AudioBuffer that has too many channels * webaudio/audiobuffersource-channels-expected.txt: * webaudio/audiobuffersource-channels.html: Canonical link: https://commits.webkit.org/174886@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-20 01:30:11 +00:00
PASS source.buffer is not null
PASS source.buffer = null did not throw exception.
PASS source.buffer is null
PASS successfullyParsed is true
TEST COMPLETE