diff --git a/components/script/dom/audionode.rs b/components/script/dom/audionode.rs index 204f38e2e5d..48751dabeac 100644 --- a/components/script/dom/audionode.rs +++ b/components/script/dom/audionode.rs @@ -237,9 +237,10 @@ impl AudioNodeMethods for AudioNode { } }, EventTargetTypeId::AudioNode(AudioNodeTypeId::ChannelMergerNode) => { - if value != 1 { - return Err(Error::InvalidState); - } + return Err(Error::InvalidState); + }, + EventTargetTypeId::AudioNode(AudioNodeTypeId::ChannelSplitterNode) => { + return Err(Error::InvalidState); }, // XXX We do not support any of the other AudioNodes with // constraints yet. Add more cases here as we add support @@ -280,9 +281,10 @@ impl AudioNodeMethods for AudioNode { } }, EventTargetTypeId::AudioNode(AudioNodeTypeId::ChannelMergerNode) => { - if value != ChannelCountMode::Explicit { - return Err(Error::InvalidState); - } + return Err(Error::InvalidState); + }, + EventTargetTypeId::AudioNode(AudioNodeTypeId::ChannelSplitterNode) => { + return Err(Error::InvalidState); }, // XXX We do not support any of the other AudioNodes with // constraints yet. Add more cases here as we add support @@ -301,14 +303,22 @@ impl AudioNodeMethods for AudioNode { } // https://webaudio.github.io/web-audio-api/#dom-audionode-channelinterpretation - fn SetChannelInterpretation(&self, value: ChannelInterpretation) { + fn SetChannelInterpretation(&self, value: ChannelInterpretation) -> ErrorResult { // Channel interpretation mode has no effect for nodes with no inputs. if self.number_of_inputs == 0 { - return; + return Ok(()); } + match self.upcast::().type_id() { + EventTargetTypeId::AudioNode(AudioNodeTypeId::ChannelSplitterNode) => { + return Err(Error::InvalidState); + }, + _ => (), + }; + self.channel_interpretation.set(value); self.message(AudioNodeMessage::SetChannelInterpretation(value.into())); + Ok(()) } } diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs index 697b152ee69..9429a03c1aa 100644 --- a/components/script/dom/baseaudiocontext.rs +++ b/components/script/dom/baseaudiocontext.rs @@ -22,6 +22,7 @@ use crate::dom::bindings::codegen::Bindings::BaseAudioContextBinding::DecodeErro use crate::dom::bindings::codegen::Bindings::BaseAudioContextBinding::DecodeSuccessCallback; use crate::dom::bindings::codegen::Bindings::BiquadFilterNodeBinding::BiquadFilterOptions; use crate::dom::bindings::codegen::Bindings::ChannelMergerNodeBinding::ChannelMergerOptions; +use crate::dom::bindings::codegen::Bindings::ChannelSplitterNodeBinding::ChannelSplitterOptions; use crate::dom::bindings::codegen::Bindings::GainNodeBinding::GainOptions; use crate::dom::bindings::codegen::Bindings::OscillatorNodeBinding::OscillatorOptions; use crate::dom::bindings::codegen::Bindings::PannerNodeBinding::PannerOptions; @@ -33,6 +34,7 @@ use crate::dom::bindings::reflector::DomObject; use crate::dom::bindings::root::{DomRoot, MutNullableDom}; use crate::dom::biquadfilternode::BiquadFilterNode; use crate::dom::channelmergernode::ChannelMergerNode; +use crate::dom::channelsplitternode::ChannelSplitterNode; use crate::dom::domexception::{DOMErrorName, DOMException}; use crate::dom::eventtarget::EventTarget; use crate::dom::gainnode::GainNode; @@ -360,6 +362,13 @@ impl BaseAudioContextMethods for BaseAudioContext { ChannelMergerNode::new(&self.global().as_window(), &self, &opts) } + /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelsplitter + fn CreateChannelSplitter(&self, count: u32) -> Fallible> { + let mut opts = ChannelSplitterOptions::empty(); + opts.numberOfOutputs = count; + ChannelSplitterNode::new(&self.global().as_window(), &self, &opts) + } + /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createbuffer fn CreateBuffer( &self, diff --git a/components/script/dom/channelsplitternode.rs b/components/script/dom/channelsplitternode.rs new file mode 100644 index 00000000000..6803e3e5a67 --- /dev/null +++ b/components/script/dom/channelsplitternode.rs @@ -0,0 +1,80 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use crate::dom::audionode::{AudioNode, MAX_CHANNEL_COUNT}; +use crate::dom::baseaudiocontext::BaseAudioContext; +use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{ + ChannelCountMode, ChannelInterpretation, +}; +use crate::dom::bindings::codegen::Bindings::ChannelSplitterNodeBinding::{ + self, ChannelSplitterOptions, +}; +use crate::dom::bindings::error::{Error, Fallible}; +use crate::dom::bindings::reflector::reflect_dom_object; +use crate::dom::bindings::root::DomRoot; +use crate::dom::window::Window; +use dom_struct::dom_struct; +use servo_media::audio::node::AudioNodeInit; + +#[dom_struct] +pub struct ChannelSplitterNode { + node: AudioNode, +} + +impl ChannelSplitterNode { + #[allow(unrooted_must_root)] + pub fn new_inherited( + _: &Window, + context: &BaseAudioContext, + options: &ChannelSplitterOptions, + ) -> Fallible { + if options.numberOfOutputs < 1 || options.numberOfOutputs > MAX_CHANNEL_COUNT { + return Err(Error::IndexSize); + } + + let node_options = options.parent.unwrap_or( + options.numberOfOutputs, + ChannelCountMode::Explicit, + ChannelInterpretation::Discrete, + ); + + if node_options.count != options.numberOfOutputs || + node_options.mode != ChannelCountMode::Explicit || + node_options.interpretation != ChannelInterpretation::Discrete + { + return Err(Error::InvalidState); + } + + let node = AudioNode::new_inherited( + AudioNodeInit::ChannelSplitterNode, + context, + node_options, + 1, // inputs + options.numberOfOutputs, // outputs + )?; + Ok(ChannelSplitterNode { node }) + } + + #[allow(unrooted_must_root)] + pub fn new( + window: &Window, + context: &BaseAudioContext, + options: &ChannelSplitterOptions, + ) -> Fallible> { + let node = ChannelSplitterNode::new_inherited(window, context, options)?; + Ok(reflect_dom_object( + Box::new(node), + window, + ChannelSplitterNodeBinding::Wrap, + )) + } + + pub fn Constructor( + window: &Window, + context: &BaseAudioContext, + options: &ChannelSplitterOptions, + ) -> Fallible> { + ChannelSplitterNode::new(window, context, options) + } +} diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index 253dc2b54bb..675b9dcd403 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -244,6 +244,7 @@ pub mod canvasgradient; pub mod canvaspattern; pub mod canvasrenderingcontext2d; pub mod channelmergernode; +pub mod channelsplitternode; pub mod characterdata; pub mod client; pub mod closeevent; diff --git a/components/script/dom/webidls/AudioNode.webidl b/components/script/dom/webidls/AudioNode.webidl index f5e51689cf2..bf4f88e02b6 100644 --- a/components/script/dom/webidls/AudioNode.webidl +++ b/components/script/dom/webidls/AudioNode.webidl @@ -57,5 +57,6 @@ interface AudioNode : EventTarget { attribute unsigned long channelCount; [SetterThrows] attribute ChannelCountMode channelCountMode; + [SetterThrows] attribute ChannelInterpretation channelInterpretation; }; diff --git a/components/script/dom/webidls/BaseAudioContext.webidl b/components/script/dom/webidls/BaseAudioContext.webidl index 5c475d5233a..0f645177d31 100644 --- a/components/script/dom/webidls/BaseAudioContext.webidl +++ b/components/script/dom/webidls/BaseAudioContext.webidl @@ -45,7 +45,7 @@ interface BaseAudioContext : EventTarget { [Throws] PannerNode createPanner(); // StereoPannerNode createStereoPanner(); // ConvolverNode createConvolver(); - // ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6); + [Throws] ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6); [Throws] ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6); // DynamicsCompressorNode createDynamicsCompressor(); [Throws] OscillatorNode createOscillator(); diff --git a/components/script/dom/webidls/ChannelSplitterNode.webidl b/components/script/dom/webidls/ChannelSplitterNode.webidl new file mode 100644 index 00000000000..1056fce61bf --- /dev/null +++ b/components/script/dom/webidls/ChannelSplitterNode.webidl @@ -0,0 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#channelsplitternode + */ + +dictionary ChannelSplitterOptions : AudioNodeOptions { + unsigned long numberOfOutputs = 6; +}; + +[Exposed=Window, + Constructor (BaseAudioContext context, optional ChannelSplitterOptions options)] +interface ChannelSplitterNode : AudioNode { +}; diff --git a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini index cc847e7578d..97d23d249e2 100644 --- a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini +++ b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini @@ -1,7 +1,4 @@ [idlharness.https.window.html] - [BaseAudioContext interface: operation createChannelSplitter(unsigned long)] - expected: FAIL - [AudioNode interface: calling connect(AudioNode, unsigned long, unsigned long) on new ConvolverNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -35,9 +32,6 @@ [AudioNode interface: calling disconnect(AudioNode) on new ConvolverNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "channelCountMode" with the proper type] - expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "disconnect(unsigned long)" with the proper type] expected: FAIL @@ -65,9 +59,6 @@ [ScriptProcessorNode interface: context.createScriptProcessor() must inherit property "onaudioprocess" with the proper type] expected: FAIL - [AudioNode interface: calling disconnect(unsigned long) on new ChannelSplitterNode(context) with too few arguments must throw TypeError] - expected: FAIL - [MediaElementAudioSourceNode interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL @@ -107,9 +98,6 @@ [AudioNode interface: new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type] expected: FAIL - [ChannelSplitterNode interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "context" with the proper type] expected: FAIL @@ -131,9 +119,6 @@ [Stringification of new StereoPannerNode(context)] expected: FAIL - [ChannelSplitterNode interface object name] - expected: FAIL - [AudioContext interface: operation close()] expected: FAIL @@ -161,9 +146,6 @@ [ScriptProcessorNode must be primary interface of context.createScriptProcessor()] expected: FAIL - [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createChannelSplitter(unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "disconnect(unsigned long)" with the proper type] expected: FAIL @@ -212,9 +194,6 @@ [AudioWorkletNode interface: existence and properties of interface object] expected: FAIL - [Stringification of new ChannelSplitterNode(context)] - expected: FAIL - [AudioNode interface: context.createScriptProcessor() must inherit property "disconnect(unsigned long)" with the proper type] expected: FAIL @@ -320,9 +299,6 @@ [AudioNode interface: new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) must inherit property "channelCountMode" with the proper type] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "numberOfInputs" with the proper type] - expected: FAIL - [AudioNode interface: calling connect(AudioParam, unsigned long) on new DelayNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -335,9 +311,6 @@ [MediaStreamAudioSourceNode interface object name] expected: FAIL - [ChannelSplitterNode interface object length] - expected: FAIL - [AudioContext interface: context must inherit property "createMediaStreamTrackSource(MediaStreamTrack)" with the proper type] expected: FAIL @@ -359,27 +332,18 @@ [IIRFilterNode interface: operation getFrequencyResponse(Float32Array, Float32Array, Float32Array)] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "disconnect(AudioNode)" with the proper type] - expected: FAIL - [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new ConstantSourceNode(context) with too few arguments must throw TypeError] expected: FAIL [AudioNode interface: context.createScriptProcessor() must inherit property "connect(AudioParam, unsigned long)" with the proper type] expected: FAIL - [ChannelSplitterNode interface: existence and properties of interface prototype object] - expected: FAIL - [AudioNode interface: new ConvolverNode(context) must inherit property "disconnect(unsigned long)" with the proper type] expected: FAIL [MediaStreamAudioDestinationNode interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new ChannelSplitterNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioParamMap interface: existence and properties of interface object] expected: FAIL @@ -578,9 +542,6 @@ [MediaStreamAudioDestinationNode interface: existence and properties of interface prototype object] expected: FAIL - [AudioNode interface: calling disconnect(AudioParam) on new ChannelSplitterNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioNode, unsigned long, unsigned long)" with the proper type] expected: FAIL @@ -626,9 +587,6 @@ [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: calling connect(AudioNode, unsigned long, unsigned long) on new ChannelSplitterNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type] expected: FAIL @@ -701,9 +659,6 @@ [AudioWorkletNode interface: existence and properties of interface prototype object] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "channelInterpretation" with the proper type] - expected: FAIL - [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createScriptProcessor(unsigned long, unsigned long, unsigned long)" with the proper type] expected: FAIL @@ -740,9 +695,6 @@ [AudioNode interface: calling connect(AudioParam, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError] expected: FAIL - [BaseAudioContext interface: context must inherit property "createChannelSplitter(unsigned long)" with the proper type] - expected: FAIL - [OscillatorNode interface: new OscillatorNode(context) must inherit property "setPeriodicWave(PeriodicWave)" with the proper type] expected: FAIL @@ -755,9 +707,6 @@ [Stringification of new AudioProcessingEvent('', {\n playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer\n })] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: worklet_node must inherit property "channelCount" with the proper type] expected: FAIL @@ -806,9 +755,6 @@ [AudioParam interface: operation setValueCurveAtTime([object Object\], double, double)] expected: FAIL - [BaseAudioContext interface: calling createChannelSplitter(unsigned long) on new OfflineAudioContext(1, 1, sample_rate) with too few arguments must throw TypeError] - expected: FAIL - [BaseAudioContext interface: operation createIIRFilter([object Object\], [object Object\])] expected: FAIL @@ -863,12 +809,6 @@ [AudioNode interface: new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) must inherit property "context" with the proper type] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "disconnect()" with the proper type] - expected: FAIL - - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "connect(AudioNode, unsigned long, unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new DelayNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -890,9 +830,6 @@ [WaveShaperNode interface: new WaveShaperNode(context) must inherit property "curve" with the proper type] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "disconnect(unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) must inherit property "connect(AudioParam, unsigned long)" with the proper type] expected: FAIL @@ -917,9 +854,6 @@ [DynamicsCompressorNode interface: new DynamicsCompressorNode(context) must inherit property "ratio" with the proper type] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "context" with the proper type] - expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "numberOfOutputs" with the proper type] expected: FAIL @@ -935,18 +869,12 @@ [DynamicsCompressorNode interface: attribute release] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "numberOfOutputs" with the proper type] - expected: FAIL - [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) with too few arguments must throw TypeError] expected: FAIL [ConvolverNode interface: attribute buffer] expected: FAIL - [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new ChannelSplitterNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: calling disconnect(AudioNode) on new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) with too few arguments must throw TypeError] expected: FAIL @@ -1055,9 +983,6 @@ [AudioNode interface: calling disconnect(AudioNode) on context.createScriptProcessor() with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "channelCount" with the proper type] - expected: FAIL - [PeriodicWave interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL @@ -1076,9 +1001,6 @@ [ConstantSourceNode interface: new ConstantSourceNode(context) must inherit property "offset" with the proper type] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long) on new ChannelSplitterNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfInputs" with the proper type] expected: FAIL @@ -1097,9 +1019,6 @@ [IIRFilterNode interface: new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) must inherit property "getFrequencyResponse(Float32Array, Float32Array, Float32Array)" with the proper type] expected: FAIL - [ChannelSplitterNode interface: existence and properties of interface object] - expected: FAIL - [AudioScheduledSourceNode interface: new ConstantSourceNode(context) must inherit property "stop(double)" with the proper type] expected: FAIL @@ -1244,9 +1163,6 @@ [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "channelInterpretation" with the proper type] expected: FAIL - [BaseAudioContext interface: calling createChannelSplitter(unsigned long) on context with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioParam, unsigned long)" with the proper type] expected: FAIL @@ -1307,12 +1223,6 @@ [MediaStreamTrackAudioSourceNode interface object name] expected: FAIL - [ChannelSplitterNode interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type] - expected: FAIL - [Stringification of context.createScriptProcessor()] expected: FAIL @@ -1331,9 +1241,6 @@ [DynamicsCompressorNode interface object name] expected: FAIL - [AudioNode interface: calling connect(AudioParam, unsigned long) on new ChannelSplitterNode(context) with too few arguments must throw TypeError] - expected: FAIL - [WaveShaperNode interface: existence and properties of interface prototype object] expected: FAIL @@ -1370,9 +1277,6 @@ [AudioNode interface: new DelayNode(context) must inherit property "numberOfOutputs" with the proper type] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect(AudioParam)" with the proper type] expected: FAIL @@ -1424,9 +1328,6 @@ [AudioNode interface: context.createScriptProcessor() must inherit property "disconnect(AudioNode, unsigned long)" with the proper type] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode) on new ChannelSplitterNode(context) with too few arguments must throw TypeError] - expected: FAIL - [WaveShaperNode interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL @@ -1445,9 +1346,6 @@ [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "connect(AudioParam, unsigned long)" with the proper type] expected: FAIL - [ChannelSplitterNode must be primary interface of new ChannelSplitterNode(context)] - expected: FAIL - [Stringification of new MediaStreamAudioDestinationNode(context)] expected: FAIL @@ -1466,9 +1364,6 @@ [Stringification of new DynamicsCompressorNode(context)] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "disconnect(AudioParam)" with the proper type] - expected: FAIL - [StereoPannerNode interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL @@ -1595,9 +1490,6 @@ [AudioProcessingEvent interface: new AudioProcessingEvent('', {\n playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer\n }) must inherit property "inputBuffer" with the proper type] expected: FAIL - [AudioNode interface: new ChannelSplitterNode(context) must inherit property "connect(AudioParam, unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: context.createScriptProcessor() must inherit property "disconnect(AudioNode)" with the proper type] expected: FAIL diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html.ini index 45d61e35bb6..10736e7e87a 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect.html.ini @@ -1,2 +1,28 @@ [audionode-disconnect.html] - expected: ERROR + [X splitter.disconnect(gain2, 2) did not throw an exception.] + expected: FAIL + + [X splitter.disconnect(2) did not throw an exception.] + expected: FAIL + + [X gain1.disconnect(gain3) did not throw an exception.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 7 tasks were failed.] + expected: FAIL + + [X splitter.disconnect(gain3, 0, 0) did not throw an exception.] + expected: FAIL + + [X splitter.disconnect(merger, 3, 0) did not throw an exception.] + expected: FAIL + + [< [exceptions\] 7 out of 8 assertions were failed.] + expected: FAIL + + [X gain1.disconnect(gain2) did not throw an exception.] + expected: FAIL + + [X splitter.disconnect(gain1, 0) did not throw an exception.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html.ini deleted file mode 100644 index 32e0f35871f..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-channelsplitternode-interface/audiochannelsplitter.html.ini +++ /dev/null @@ -1,11 +0,0 @@ -[audiochannelsplitter.html] - expected: ERROR - [X createChannelSplitter(33) threw "TypeError" instead of IndexSizeError.] - expected: FAIL - - [X splitternode = context.createChannelSplitter(32) incorrectly threw TypeError: "context.createChannelSplitter is not a function".] - expected: FAIL - - [X createChannelSplitter(0) threw "TypeError" instead of IndexSizeError.] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html.ini deleted file mode 100644 index 65bfcd5f405..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-channelsplitternode-interface/ctor-channelsplitter.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[ctor-channelsplitter.html] - expected: ERROR - [X node0 = new ChannelSplitterNode(context) incorrectly threw TypeError: "window[name\] is not a constructor".] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-gainnode-interface/gain.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-gainnode-interface/gain.html.ini index 4c84e0baf87..831bcdd7e3d 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-gainnode-interface/gain.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-gainnode-interface/gain.html.ini @@ -1,2 +1,13 @@ [gain.html] - expected: ERROR + [X Left SNR (in dB) is not greater than or equal to 148.69. Got NaN.] + expected: FAIL + + [X Right SNR (in dB) is not greater than or equal to 148.69. Got NaN.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 2 tasks were failed.] + expected: FAIL + + [< [test\] 2 out of 4 assertions were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-automation-position.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-automation-position.html.ini index 2c76c302d1b..95df5efaaac 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-automation-position.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-automation-position.html.ini @@ -1,2 +1,22 @@ [panner-automation-position.html] - expected: ERROR + [# AUDIT TASK RUNNER FINISHED: 2 out of 8 tasks were failed.] + expected: FAIL + + [X 2-channel [0, 0, 1\] -> [0, 0, 10000\]: distanceModel: inverse, rolloff: 1, right channel does not equal [2,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16,2.4492937051703357e-16...\] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[0\]\t0.0000000000000000e+0\t2.0000000000000000e+0\t2.0000000000000000e+0\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[1\]\t0.0000000000000000e+0\t2.4492937051703357e-16\t2.4492937051703357e-16\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[2\]\t0.0000000000000000e+0\t2.4492937051703357e-16\t2.4492937051703357e-16\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[3\]\t0.0000000000000000e+0\t2.4492937051703357e-16\t2.4492937051703357e-16\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[4\]\t0.0000000000000000e+0\t2.4492937051703357e-16\t2.4492937051703357e-16\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t...and 251 more errors.\n\tMax AbsError of 2.0000000000000000e+0 at index of 0.\n\tMax RelError of 1.0000000000000000e+0 at index of 0.\n] + expected: FAIL + + [X 1-channel [0, 0, 1\] -> [0, 0, 10000\]: distanceModel: inverse, rolloff: 1, left channel does not equal [0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304,-0.7071067690849304...\] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[0\]\t0.0000000000000000e+0\t7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[1\]\t0.0000000000000000e+0\t-7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[2\]\t0.0000000000000000e+0\t-7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[3\]\t0.0000000000000000e+0\t-7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[4\]\t0.0000000000000000e+0\t-7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t...and 251 more errors.\n\tMax AbsError of 7.0710676908493042e-1 at index of 0.\n\tMax RelError of 1.0000000000000000e+0 at index of 0.\n] + expected: FAIL + + [X 1-channel [0, 0, 1\] -> [0, 0, 10000\]: distanceModel: inverse, rolloff: 1, right channel does not equal [0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304,0.7071067690849304...\] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[0\]\t0.0000000000000000e+0\t7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[1\]\t0.0000000000000000e+0\t7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[2\]\t0.0000000000000000e+0\t7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[3\]\t0.0000000000000000e+0\t7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[4\]\t0.0000000000000000e+0\t7.0710676908493042e-1\t7.0710676908493042e-1\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t...and 251 more errors.\n\tMax AbsError of 7.0710676908493042e-1 at index of 0.\n\tMax RelError of 1.0000000000000000e+0 at index of 0.\n] + expected: FAIL + + [X 2-channel [0, 0, 1\] -> [0, 0, 10000\]: distanceModel: inverse, rolloff: 1, left channel does not equal [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1...\] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[0\]\t0.0000000000000000e+0\t1.0000000000000000e+0\t1.0000000000000000e+0\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[1\]\t0.0000000000000000e+0\t-1.0000000000000000e+0\t1.0000000000000000e+0\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[2\]\t0.0000000000000000e+0\t-1.0000000000000000e+0\t1.0000000000000000e+0\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[3\]\t0.0000000000000000e+0\t-1.0000000000000000e+0\t1.0000000000000000e+0\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t[4\]\t0.0000000000000000e+0\t-1.0000000000000000e+0\t1.0000000000000000e+0\t1.0000000000000000e+0\t0.0000000000000000e+0\n\t...and 251 more errors.\n\tMax AbsError of 1.0000000000000000e+0 at index of 0.\n\tMax RelError of 1.0000000000000000e+0 at index of 0.\n] + expected: FAIL + + [< [0: 2-channel inverse rolloff: 1\] 2 out of 2 assertions were failed.] + expected: FAIL + + [< [0: 1-channel inverse rolloff: 1\] 2 out of 2 assertions were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-distance-clamping.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-distance-clamping.html.ini deleted file mode 100644 index 590a0e116bd..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-distance-clamping.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[panner-distance-clamping.html] - expected: ERROR diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 5283e0ae9cb..03ca02fce8b 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -27080,7 +27080,7 @@ "testharness" ], "mozilla/interfaces.html": [ - "8153d67c8cb4e554b05ac884e9898f50508349be", + "95ab0109c82c8e90a3e53a3579b9337e2091e26c", "testharness" ], "mozilla/interfaces.js": [ diff --git a/tests/wpt/mozilla/tests/mozilla/interfaces.html b/tests/wpt/mozilla/tests/mozilla/interfaces.html index 8153d67c8cb..95ab0109c82 100644 --- a/tests/wpt/mozilla/tests/mozilla/interfaces.html +++ b/tests/wpt/mozilla/tests/mozilla/interfaces.html @@ -30,6 +30,7 @@ test_interfaces([ "CanvasRenderingContext2D", "CanvasPattern", "ChannelMergerNode", + "ChannelSplitterNode", "CharacterData", "CloseEvent", "CSS",