diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs index 80eae097a8f..22f20f2031d 100644 --- a/components/script/dom/baseaudiocontext.rs +++ b/components/script/dom/baseaudiocontext.rs @@ -24,6 +24,7 @@ use crate::dom::bindings::codegen::Bindings::BaseAudioContextBinding::DecodeSucc 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::ConstantSourceNodeBinding::ConstantSourceOptions; use crate::dom::bindings::codegen::Bindings::GainNodeBinding::GainOptions; use crate::dom::bindings::codegen::Bindings::OscillatorNodeBinding::OscillatorOptions; use crate::dom::bindings::codegen::Bindings::PannerNodeBinding::PannerOptions; @@ -37,6 +38,7 @@ 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::constantsourcenode::ConstantSourceNode; use crate::dom::domexception::{DOMErrorName, DOMException}; use crate::dom::eventtarget::EventTarget; use crate::dom::gainnode::GainNode; @@ -378,6 +380,15 @@ impl BaseAudioContextMethods for BaseAudioContext { ) } + /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createconstantsource + fn CreateConstantSource(&self) -> Fallible> { + ConstantSourceNode::new( + &self.global().as_window(), + &self, + &ConstantSourceOptions::empty(), + ) + } + /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelmerger fn CreateChannelMerger(&self, count: u32) -> Fallible> { let mut opts = ChannelMergerOptions::empty(); diff --git a/components/script/dom/constantsourcenode.rs b/components/script/dom/constantsourcenode.rs new file mode 100644 index 00000000000..27ee869054d --- /dev/null +++ b/components/script/dom/constantsourcenode.rs @@ -0,0 +1,98 @@ +/* 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::audioparam::AudioParam; +use crate::dom::audioscheduledsourcenode::AudioScheduledSourceNode; +use crate::dom::baseaudiocontext::BaseAudioContext; +use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate; +use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::ConstantSourceNodeMethods; +use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::{ + self, ConstantSourceOptions, +}; +use crate::dom::bindings::error::Fallible; +use crate::dom::bindings::reflector::reflect_dom_object; +use crate::dom::bindings::root::{Dom, DomRoot}; +use crate::dom::window::Window; +use dom_struct::dom_struct; +use servo_media::audio::constant_source_node::ConstantSourceNodeOptions as ServoMediaConstantSourceOptions; +use servo_media::audio::node::AudioNodeInit; +use servo_media::audio::param::ParamType; +use std::f32; + +#[dom_struct] +pub struct ConstantSourceNode { + source_node: AudioScheduledSourceNode, + offset: Dom, +} + +impl ConstantSourceNode { + #[allow(unrooted_must_root)] + fn new_inherited( + window: &Window, + context: &BaseAudioContext, + options: &ConstantSourceOptions, + ) -> Fallible { + let node_options = Default::default(); + let source_node = AudioScheduledSourceNode::new_inherited( + AudioNodeInit::ConstantSourceNode(options.into()), + context, + node_options, /* 2, MAX, Speakers */ + 0, /* inputs */ + 1, /* outputs */ + )?; + let node_id = source_node.node().node_id(); + let offset = AudioParam::new( + window, + context, + node_id, + ParamType::Offset, + AutomationRate::A_rate, + *options.offset, + f32::MIN, + f32::MAX, + ); + + Ok(ConstantSourceNode { + source_node, + offset: Dom::from_ref(&offset), + }) + } + + #[allow(unrooted_must_root)] + pub fn new( + window: &Window, + context: &BaseAudioContext, + options: &ConstantSourceOptions, + ) -> Fallible> { + let node = ConstantSourceNode::new_inherited(window, context, options)?; + Ok(reflect_dom_object( + Box::new(node), + window, + ConstantSourceNodeBinding::Wrap, + )) + } + + pub fn Constructor( + window: &Window, + context: &BaseAudioContext, + options: &ConstantSourceOptions, + ) -> Fallible> { + ConstantSourceNode::new(window, context, options) + } +} + +impl ConstantSourceNodeMethods for ConstantSourceNode { + // https://webaudio.github.io/web-audio-api/#dom-constantsourcenode-offset + fn Offset(&self) -> DomRoot { + DomRoot::from_ref(&self.offset) + } +} + +impl<'a> From<&'a ConstantSourceOptions> for ServoMediaConstantSourceOptions { + fn from(options: &'a ConstantSourceOptions) -> Self { + Self { + offset: *options.offset, + } + } +} diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index ff36a485529..02be0f69c83 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -254,6 +254,7 @@ pub mod closeevent; pub mod comment; pub mod compositionevent; pub mod console; +pub mod constantsourcenode; mod create; pub mod crypto; pub mod css; diff --git a/components/script/dom/webidls/BaseAudioContext.webidl b/components/script/dom/webidls/BaseAudioContext.webidl index ee2cbc7c2d3..57fb677defd 100644 --- a/components/script/dom/webidls/BaseAudioContext.webidl +++ b/components/script/dom/webidls/BaseAudioContext.webidl @@ -31,7 +31,7 @@ interface BaseAudioContext : EventTarget { optional DecodeSuccessCallback successCallback, optional DecodeErrorCallback errorCallback); [Throws] AudioBufferSourceNode createBufferSource(); - // ConstantSourceNode createConstantSource(); + [Throws] ConstantSourceNode createConstantSource(); // ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0, // optional unsigned long numberOfInputChannels = 2, // optional unsigned long numberOfOutputChannels = 2); diff --git a/components/script/dom/webidls/ConstantSourceNode.webidl b/components/script/dom/webidls/ConstantSourceNode.webidl new file mode 100644 index 00000000000..6fb8dca1988 --- /dev/null +++ b/components/script/dom/webidls/ConstantSourceNode.webidl @@ -0,0 +1,17 @@ +/* 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/#ConstantSourceNode + */ + +dictionary ConstantSourceOptions: AudioNodeOptions { + float offset = 1; +}; + +[Exposed=Window, + Constructor (BaseAudioContext context, optional ConstantSourceOptions options = {})] +interface ConstantSourceNode : AudioScheduledSourceNode { + readonly attribute AudioParam offset; +}; diff --git a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini index 2557846cc75..37aa74faea8 100644 --- a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini +++ b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini @@ -14,27 +14,15 @@ [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new ConvolverNode(context) with too few arguments must throw TypeError] expected: FAIL - [ConstantSourceNode interface: existence and properties of interface prototype object] - expected: FAIL - - [AudioNode interface: new ConstantSourceNode(context) must inherit property "channelInterpretation" with the proper type] - expected: FAIL - [AudioNode interface: new DelayNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type] expected: FAIL [AudioNode interface: calling disconnect(AudioNode) on new ConvolverNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "disconnect(unsigned long)" with the proper type] - expected: FAIL - [AudioProcessingEvent interface: new AudioProcessingEvent('', {\n playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer\n }) must inherit property "outputBuffer" with the proper type] expected: FAIL - [ConstantSourceNode interface: attribute offset] - expected: FAIL - [AudioContext interface: context must inherit property "createMediaStreamSource(MediaStream)" with the proper type] expected: FAIL @@ -71,12 +59,6 @@ [AudioNode interface: calling disconnect(AudioNode) on new WaveShaperNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new ConstantSourceNode(context) must inherit property "numberOfInputs" with the proper type] - expected: FAIL - [AudioNode interface: new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) must inherit property "disconnect(AudioNode)" with the proper type] expected: FAIL @@ -101,24 +83,15 @@ [AudioNode interface: calling disconnect(AudioParam) on context.createScriptProcessor() with too few arguments must throw TypeError] expected: FAIL - [ConstantSourceNode interface object length] - expected: FAIL - [AudioContext interface: operation close()] expected: FAIL [AudioProcessingEvent interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL - [BaseAudioContext interface: operation createConstantSource()] - expected: FAIL - [WaveShaperNode interface: attribute curve] expected: FAIL - [BaseAudioContext interface: context must inherit property "createConstantSource()" with the proper type] - expected: FAIL - [AudioWorkletNode interface: attribute onprocessorerror] expected: FAIL @@ -212,9 +185,6 @@ [AudioNode interface: calling disconnect(AudioNode, unsigned long) on new DynamicsCompressorNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: calling connect(AudioNode, unsigned long, unsigned long) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: calling connect(AudioParam, unsigned long) on new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) with too few arguments must throw TypeError] expected: FAIL @@ -287,18 +257,12 @@ [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: calling disconnect(unsigned long) on new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) with too few arguments must throw TypeError] expected: FAIL [IIRFilterNode interface: operation getFrequencyResponse(Float32Array, Float32Array, Float32Array)] 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 @@ -425,9 +389,6 @@ [PeriodicWave interface: existence and properties of interface object] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "context" with the proper type] - expected: FAIL - [AudioNode interface: calling disconnect(AudioParam) on new DynamicsCompressorNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -446,9 +407,6 @@ [DelayNode interface: new DelayNode(context) must inherit property "delayTime" with the proper type] expected: FAIL - [AudioNode interface: calling disconnect(AudioParam) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioProcessingEvent interface: attribute inputBuffer] expected: FAIL @@ -488,9 +446,6 @@ [Stringification of new PeriodicWave(context)] expected: FAIL - [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createConstantSource()" with the proper type] - expected: FAIL - [AudioNode interface: calling disconnect(AudioParam) on new DelayNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -500,15 +455,9 @@ [DelayNode interface: existence and properties of interface prototype object] expected: FAIL - [AudioNode interface: calling connect(AudioParam, unsigned long) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "disconnect()" with the proper type] - expected: FAIL - [DynamicsCompressorNode interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL @@ -530,9 +479,6 @@ [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "channelCountMode" with the proper type] expected: FAIL - [AudioScheduledSourceNode interface: calling start(double) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - [MediaElementAudioSourceNode interface object length] expected: FAIL @@ -548,9 +494,6 @@ [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new DynamicsCompressorNode(context) with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "numberOfOutputs" with the proper type] - expected: FAIL - [BaseAudioContext interface: operation createScriptProcessor(unsigned long, unsigned long, unsigned long)] expected: FAIL @@ -560,18 +503,12 @@ [BaseAudioContext interface: calling createDelay(double) on context with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - [DynamicsCompressorNode interface: new DynamicsCompressorNode(context) must inherit property "threshold" with the proper type] expected: FAIL [AudioNode interface: new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) must inherit property "disconnect(unsigned long)" with the proper type] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "connect(AudioNode, unsigned long, unsigned long)" with the proper type] - expected: FAIL - [AudioNode interface: new ConvolverNode(context) must inherit property "numberOfOutputs" with the proper type] expected: FAIL @@ -599,12 +536,6 @@ [AudioParamMap interface: existence and properties of interface prototype object] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "connect(AudioParam, unsigned long)" with the proper type] - expected: FAIL - - [AudioNode interface: new ConstantSourceNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type] - expected: FAIL - [IIRFilterNode interface: existence and properties of interface prototype object] expected: FAIL @@ -635,9 +566,6 @@ [PeriodicWave interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL - [AudioScheduledSourceNode interface: calling stop(double) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - [Stringification of new AudioProcessingEvent('', {\n playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer\n })] expected: FAIL @@ -743,15 +671,9 @@ [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "disconnect(unsigned long)" with the proper type] expected: FAIL - [ConstantSourceNode interface object name] - expected: FAIL - [MediaStreamAudioDestinationNode must be primary interface of new MediaStreamAudioDestinationNode(context)] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type] - expected: FAIL - [WaveShaperNode interface: new WaveShaperNode(context) must inherit property "curve" with the proper type] expected: FAIL @@ -764,9 +686,6 @@ [ConvolverNode interface: new ConvolverNode(context) must inherit property "buffer" with the proper type] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "channelCount" with the proper type] - expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long) on new ConvolverNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -806,9 +725,6 @@ [OfflineAudioContext interface: operation resume()] expected: FAIL - [AudioScheduledSourceNode interface: new ConstantSourceNode(context) must inherit property "start(double)" with the proper type] - expected: FAIL - [AudioNode interface: new DynamicsCompressorNode(context) must inherit property "numberOfInputs" with the proper type] expected: FAIL @@ -836,9 +752,6 @@ [AudioNode interface: worklet_node must inherit property "context" with the proper type] expected: FAIL - [ConstantSourceNode interface: existence and properties of interface object] - expected: FAIL - [AudioNode interface: calling disconnect(unsigned long) on new DynamicsCompressorNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -860,9 +773,6 @@ [OfflineAudioContext interface: calling suspend(double) on new OfflineAudioContext(1, 1, sample_rate) with too few arguments must throw TypeError] expected: FAIL - [ConstantSourceNode interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - [AudioWorkletNode interface: existence and properties of interface prototype object's @@unscopables property] expected: FAIL @@ -875,9 +785,6 @@ [MediaElementAudioSourceNode must be primary interface of new MediaElementAudioSourceNode(context, {mediaElement: new Audio})] expected: FAIL - [AudioNode interface: calling disconnect(unsigned long) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - [ScriptProcessorNode interface: attribute onaudioprocess] expected: FAIL @@ -905,9 +812,6 @@ [AudioWorkletNode interface: worklet_node must inherit property "parameters" with the proper type] expected: FAIL - [ConstantSourceNode interface: new ConstantSourceNode(context) must inherit property "offset" with the proper type] - expected: FAIL - [AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfInputs" with the proper type] expected: FAIL @@ -917,18 +821,12 @@ [PeriodicWave must be primary interface of new PeriodicWave(context)] expected: FAIL - [ConstantSourceNode interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new DelayNode(context) with too few arguments must throw TypeError] expected: FAIL [IIRFilterNode interface: new IIRFilterNode(context, {feedforward: [1\], feedback: [1\]}) must inherit property "getFrequencyResponse(Float32Array, Float32Array, Float32Array)" with the proper type] expected: FAIL - [AudioScheduledSourceNode interface: new ConstantSourceNode(context) must inherit property "stop(double)" with the proper type] - expected: FAIL - [AudioNode interface: new ConvolverNode(context) must inherit property "numberOfInputs" with the proper type] expected: FAIL @@ -1004,9 +902,6 @@ [AudioNode interface: calling disconnect(AudioParam, unsigned long) on context.createScriptProcessor() with too few arguments must throw TypeError] expected: FAIL - [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new ConstantSourceNode(context) with too few arguments must throw TypeError] - expected: FAIL - [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new DynamicsCompressorNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -1049,9 +944,6 @@ [IIRFilterNode interface object length] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "disconnect(AudioParam)" with the proper type] - expected: FAIL - [AudioNode interface: new MediaStreamAudioDestinationNode(context) must inherit property "channelInterpretation" with the proper type] expected: FAIL @@ -1124,9 +1016,6 @@ [AudioNode interface: new MediaElementAudioSourceNode(context, {mediaElement: new Audio}) must inherit property "channelCount" with the proper type] expected: FAIL - [AudioScheduledSourceNode interface: new ConstantSourceNode(context) must inherit property "onended" with the proper type] - expected: FAIL - [AudioNode interface: new DelayNode(context) must inherit property "channelCountMode" with the proper type] expected: FAIL @@ -1139,9 +1028,6 @@ [DynamicsCompressorNode interface: existence and properties of interface object] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "channelCountMode" with the proper type] - expected: FAIL - [IIRFilterNode interface: existence and properties of interface object] expected: FAIL @@ -1277,9 +1163,6 @@ [MediaStreamAudioSourceNode interface: existence and properties of interface prototype object] expected: FAIL - [AudioNode interface: new ConstantSourceNode(context) must inherit property "disconnect(AudioNode)" with the proper type] - expected: FAIL - [AudioNode interface: calling connect(AudioNode, unsigned long, unsigned long) on new DelayNode(context) with too few arguments must throw TypeError] expected: FAIL @@ -1337,9 +1220,6 @@ [AudioNode interface: worklet_node must inherit property "numberOfInputs" with the proper type] expected: FAIL - [Stringification of new ConstantSourceNode(context)] - expected: FAIL - [AudioNode interface: calling disconnect(AudioParam) on worklet_node with too few arguments must throw TypeError] expected: FAIL @@ -1352,9 +1232,6 @@ [AudioNode interface: context.createScriptProcessor() must inherit property "channelInterpretation" with the proper type] expected: FAIL - [ConstantSourceNode must be primary interface of new ConstantSourceNode(context)] - expected: FAIL - [AudioProcessingEvent interface: new AudioProcessingEvent('', {\n playbackTime: 0, inputBuffer: buffer, outputBuffer: buffer\n }) must inherit property "inputBuffer" with the proper type] expected: FAIL diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/audioparam-close.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/audioparam-close.html.ini index 6c0e19ae401..ce808893e24 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/audioparam-close.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/audioparam-close.html.ini @@ -1,2 +1,19 @@ [audioparam-close.html] - expected: ERROR + [# AUDIT TASK RUNNER FINISHED: 2 out of 2 tasks were failed.] + expected: FAIL + + [< [interpolation\] 1 out of 7 assertions were failed.] + expected: FAIL + + [< [no-nan\] 2 out of 5 assertions were failed.] + expected: FAIL + + [X output[0\] is not equal to 10. Got NaN.] + expected: FAIL + + [X output[1\]: Expected 3.4028234663852886e+38 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[0\]\tNaN\n\t[1\]\tNaN\n\t[2\]\tNaN\n\t[3\]\tNaN\n\t...and 123 more errors.] + expected: FAIL + + [X output[1\] is not close to 1.1342744887950962e+38 within a relative error of 0 (RelErr=2). Got 3.4028234663852886e+38.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/event-insertion.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/event-insertion.html.ini index acbb68b01a0..23792568fa4 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/event-insertion.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/event-insertion.html.ini @@ -1,2 +1,58 @@ [event-insertion.html] - expected: ERROR + [X Output at frame 512 (time 0.03125) is not equal to 4. Got 3.] + expected: FAIL + + [< [Multiple exponential ramps at the same time\] 2 out of 6 assertions were failed.] + expected: FAIL + + [< [Insert same event at same time\] 2 out of 15 assertions were failed.] + expected: FAIL + + [X Multiple linear ramps: Output at frame 64 (0.00390625 sec) is not equal to 10. Got 7.] + expected: FAIL + + [X Expo+Linear: At time 0.01556396484375 (frame 255) output is not close to 2.9871532226369792 within a relative error of 0.0000042533 (RelErr=0.6652331080903755). Got 1.] + expected: FAIL + + [X Linear+SetTarget: At time 0.015625 (frame 256) and later does not equal [100,99.93898010253906,99.87800598144531,99.81706237792969,99.75615692138672,99.6952896118164,99.63446044921875,99.57366180419922,99.51290893554688,99.45218658447266,99.39151000976562,99.33086395263672,99.27025604248047,99.20968627929688,99.1491470336914,99.08865356445312...\] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":1.7807e-7}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t1.0000000000000000e+2\t9.9938980102539063e+1\t6.1019897460937500e-2\t6.1057154473990094e-4\t1.7796134186859131e-5\n\t[2\]\t1.0000000000000000e+2\t9.9878005981445313e+1\t1.2199401855468750e-1\t1.2214302574017222e-3\t1.7785276525115967e-5\n\t[3\]\t1.0000000000000000e+2\t9.9817062377929688e+1\t1.8293762207031250e-1\t1.8327289715025855e-3\t1.7774424297637941e-5\n\t[4\]\t1.0000000000000000e+2\t9.9756156921386719e+1\t2.4384307861328125e-1\t2.4443912650468570e-3\t1.7763578862991333e-5\n\t[5\]\t1.0000000000000000e+2\t9.9695289611816406e+1\t3.0471038818359375e-1\t3.0564171022527216e-3\t1.7752740221176149e-5\n\t...and 250 more errors.\n\tMax AbsError of 1.4413246154785156e+1 at index of 255.\n\t[255\]\t1.0000000000000000e+2\t8.5586753845214844e+1\t1.4413246154785156e+1\t1.6840510367821365e-1\t1.5240433257217408e-5\n\tMax RelError of 1.6840510367821365e-1 at index of 255.\n\t[255\]\t1.0000000000000000e+2\t8.5586753845214844e+1\t1.4413246154785156e+1\t1.6840510367821365e-1\t1.5240433257217408e-5\n] + expected: FAIL + + [X Multiple exponential ramps: Output at frame 63 is not close to 1.978456026387951 within a relative error of 5.3924e-7 (RelErr=2.4304996397067242). Got 6.787092685699463.] + expected: FAIL + + [X Output at frame 640 (time 0.0390625) is not equal to 5. Got 1.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 6 out of 6 tasks were failed.] + expected: FAIL + + [< [Multiple linear ramps at the same time\] 2 out of 6 assertions were failed.] + expected: FAIL + + [X Linear+Expo: At time 0.015625 (frame 256) and later, output: Expected 3 for all values but found 256 unexpected values: \n\tIndex\tActual\n\t[0\]\t99\n\t[1\]\t99\n\t[2\]\t99\n\t[3\]\t99\n\t...and 252 more errors.] + expected: FAIL + + [X Linear+SetTarget: At time 0.01556396484375 (frame 255) output is not close to 2.9921875 within a relative error of 0 (RelErr=0.6657963446475196). Got 1.] + expected: FAIL + + [X Linear+Expo: At time 0.01556396484375 (frame 255) output is not close to 1.99609375 within a relative error of 0 (RelErr=0.49902152641878667). Got 1.] + expected: FAIL + + [X Expo+Linear: At time 0.015625 (frame 256) and later, output: Expected 2 for all values but found 256 unexpected values: \n\tIndex\tActual\n\t[0\]\t99\n\t[1\]\t99\n\t[2\]\t99\n\t[3\]\t99\n\t...and 252 more errors.] + expected: FAIL + + [X Multiple exponential ramps: Output at frame 64 (0.00390625 sec) is not equal to 10. Got 7.] + expected: FAIL + + [< [Linear + SetTarget\] 2 out of 7 assertions were failed.] + expected: FAIL + + [< [Expo + Linear\] 2 out of 6 assertions were failed.] + expected: FAIL + + [< [Linear + Expo\] 2 out of 6 assertions were failed.] + expected: FAIL + + [X Multiple linear ramps: Output at frame 63 is not close to 1.984375 within a relative error of 0 (RelErr=2.4795649971548968). Got 6.904761791229248.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/k-rate-constant-source.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/k-rate-constant-source.html.ini deleted file mode 100644 index dd19c6b7655..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/k-rate-constant-source.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[k-rate-constant-source.html] - expected: ERROR diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/k-rate-panner.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/k-rate-panner.html.ini deleted file mode 100644 index 3ca0eaddfd4..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/k-rate-panner.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[k-rate-panner.html] - expected: ERROR diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/set-target-conv.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/set-target-conv.html.ini index f6f20255f49..07257bfcbc0 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/set-target-conv.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-audioparam-interface/set-target-conv.html.ini @@ -1,5 +1,4 @@ [set-target-conv.html] - expected: ERROR [X src = new ConstantSourceNode(context) incorrectly threw ReferenceError: "ConstantSourceNode is not defined".] expected: FAIL diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html.ini deleted file mode 100644 index 0af07ce7439..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[constant-source-basic.html] - expected: ERROR - [X Factory method: node = context.createConstantSource() incorrectly threw TypeError: "context.createConstantSource is not a function".] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-output.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-output.html.ini index 36ddcdb8688..7c8029698ec 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-output.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-output.html.ini @@ -1,2 +1,22 @@ [constant-source-output.html] - expected: ERROR + [X Connected param: ConstantSourceNode frames [10, 6000) does not equal [1.5446391105651855,1.5920131206512451,1.6374239921569824,1.6807208061218262,1.7217602729797363,1.7604060173034668,1.7965298891067505,1.830012321472168,1.8607419729232788,1.8886172771453857,1.9135454893112183,1.9354441165924072,1.954240322113037,1.969871997833252,1.9822871685028076,1.9914448261260986...\] 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[119\]\t1.9689673185348511e+0\t1.9114032983779907e+0\t5.7564020156860352e-2\t3.0116103810069256e-2\t0.0000000000000000e+0\n\t[120\]\t2.0485177040100098e+0\t1.9335803985595703e+0\t1.1493730545043945e-1\t5.9442734078222211e-2\t0.0000000000000000e+0\n\t[121\]\t2.1245903968811035e+0\t1.9526615142822266e+0\t1.7192888259887695e-1\t8.8048482208180262e-2\t0.0000000000000000e+0\n\t[122\]\t2.1969339847564697e+0\t1.9685831069946289e+0\t2.2835087776184082e-1\t1.1599758067133706e-1\t0.0000000000000000e+0\n\t[123\]\t2.2653079032897949e+0\t1.9812927246093750e+0\t2.8401517868041992e-1\t1.4334841851115937e-1\t0.0000000000000000e+0\n\t...and 122 more errors.\n\tMax AbsError of 9.9994510412216187e-1 at index of 200.\n\t[200\]\t-4.5393562316894531e-1\t5.4600948095321655e-1\t9.9994510412216187e-1\t1.8313694889994769e+0\t0.0000000000000000e+0\n\tMax RelError of 3.4132869565217392e+4 at index of 181.\n\t[181\]\t-4.6791613101959229e-1\t1.3709068298339844e-5\t4.6792984008789063e-1\t3.4132869565217392e+4\t0.0000000000000000e+0\n] + expected: FAIL + + [< [connected audioparam\] 1 out of 2 assertions were failed.] + expected: FAIL + + [< [basic automation\] 1 out of 2 assertions were failed.] + expected: FAIL + + [X Automation: ConstantSourceNode.linearRamp(1, 0.5) does not equal [0.5,0.5001666666666666,0.5003333333333333,0.5005,0.5006666666666667,0.5008333333333334,0.501,0.5011666666666666,0.5013333333333333,0.5015,0.5016666666666667,0.5018333333333334,0.502,0.5021666666666667,0.5023333333333333,0.5025...\] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":7.161e-7}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t5.0000000000000000e-1\t5.0016666666666665e-1\t1.6666666666664831e-4\t3.3322225924688100e-4\t3.5816935000000001e-7\n\t[2\]\t5.0016671419143677e-1\t5.0033333333333330e-1\t1.6661914189652904e-4\t3.3301627294442850e-4\t3.5828869999999996e-7\n\t[3\]\t5.0033342838287354e-1\t5.0049999999999994e-1\t1.6657161712640978e-4\t3.3281042382899057e-4\t3.5840804999999996e-7\n\t[4\]\t5.0050014257431030e-1\t5.0066666666666670e-1\t1.6652409235640153e-4\t3.3260471176378465e-4\t3.5852740000000001e-7\n\t[5\]\t5.0066691637039185e-1\t5.0083333333333335e-1\t1.6641696294150687e-4\t3.3228012567355778e-4\t3.5864675000000001e-7\n\t...and 2982 more errors.\n\tMax AbsError of 1.6666666666664831e-4 at index of 1.\n\tMax RelError of 3.3322225924688100e-4 at index of 1.\n] + expected: FAIL + + [X start/stop: ConstantSourceNode frames [300, 6000): Expected 0 for all values but found 1 unexpected values: \n\tIndex\tActual\n\t[0\]\t1] + expected: FAIL + + [< [start/stop\] 1 out of 3 assertions were failed.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 3 out of 6 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html.ini deleted file mode 100644 index 2110cb2fbe9..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/ctor-constantsource.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[ctor-constantsource.html] - expected: ERROR - [X node0 = new ConstantSourceNode(context) incorrectly threw TypeError: "window[name\] is not a constructor".] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/test-constantsourcenode.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/test-constantsourcenode.html.ini index 5616ec2eb54..1771a603d25 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/test-constantsourcenode.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-constantsourcenode-interface/test-constantsourcenode.html.ini @@ -1,19 +1,4 @@ [test-constantsourcenode.html] - [ConstantSourceNode with no automation] - expected: FAIL - - [ConstantSourceNode stop and start] - expected: FAIL - - [ConstantSourceNode onended event] - expected: FAIL - - [ConstantSourceNode can be constructed] - expected: FAIL - - [ConstantSourceNode with automation] - expected: FAIL - [ConstantSourceNode start and stop when work] expected: FAIL diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-azimuth.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-azimuth.html.ini index 0b0e69931ef..3b102358c5e 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-azimuth.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-pannernode-interface/panner-azimuth.html.ini @@ -1,2 +1,13 @@ [panner-azimuth.html] - expected: ERROR + [X Left channel: Expected 0.7071067690849304 for all values but found 16000 unexpected values: \n\tIndex\tActual\n\t[0\]\t0\n\t[1\]\t0\n\t[2\]\t0\n\t[3\]\t0\n\t...and 15996 more errors.] + expected: FAIL + + [< [Azimuth calculation\] 2 out of 2 assertions were failed.] + expected: FAIL + + [X Righteft channel: Expected 0.7071067690849304 for all values but found 16000 unexpected values: \n\tIndex\tActual\n\t[0\]\t0\n\t[1\]\t0\n\t[2\]\t0\n\t[3\]\t0\n\t...and 15996 more errors.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 1ac3961804f..a623d546a60 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -18919,7 +18919,7 @@ "testharness" ], "mozilla/interfaces.html": [ - "cb0317a6de33cc5283f3754bece13a3b04940423", + "f30dd3de4087a45476745c4a41dd6a5f7e9365e3", "testharness" ], "mozilla/interfaces.js": [ diff --git a/tests/wpt/mozilla/tests/mozilla/interfaces.html b/tests/wpt/mozilla/tests/mozilla/interfaces.html index cb0317a6de3..f30dd3de408 100644 --- a/tests/wpt/mozilla/tests/mozilla/interfaces.html +++ b/tests/wpt/mozilla/tests/mozilla/interfaces.html @@ -36,6 +36,7 @@ test_interfaces([ "ChannelSplitterNode", "CharacterData", "CloseEvent", + "ConstantSourceNode", "CSS", "CSSConditionRule", "CSSFontFaceRule",