diff options
15 files changed, 90 insertions, 26 deletions
diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs index 86a715d1b5b..e4d8ee01dcc 100644 --- a/components/script/dom/baseaudiocontext.rs +++ b/components/script/dom/baseaudiocontext.rs @@ -348,7 +348,7 @@ impl BaseAudioContextMethods for BaseAudioContext { /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createbiquadfilter fn CreateBiquadFilter(&self) -> Fallible<DomRoot<BiquadFilterNode>> { - BiquadFilterNode::new(&self.global().as_window(), &self, &BiquadFilter::empty()) + BiquadFilterNode::new(&self.global().as_window(), &self, &BiquadFilterOptions::empty()) } /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelmerger diff --git a/components/script/dom/biquadfilternode.rs b/components/script/dom/biquadfilternode.rs index 77c39ca7d04..2ee309498be 100644 --- a/components/script/dom/biquadfilternode.rs +++ b/components/script/dom/biquadfilternode.rs @@ -128,17 +128,17 @@ impl BiquadFilterNodeMethods for BiquadFilterNode { // https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-q fn Q(&self) -> DomRoot<AudioParam> { - DomRoot::from_ref(&self.gain) + DomRoot::from_ref(&self.q) } // https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-detune fn Detune(&self) -> DomRoot<AudioParam> { - DomRoot::from_ref(&self.gain) + DomRoot::from_ref(&self.detune) } // https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-frequency fn Frequency(&self) -> DomRoot<AudioParam> { - DomRoot::from_ref(&self.gain) + DomRoot::from_ref(&self.frequency) } // https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-type diff --git a/components/script/dom/webidls/BaseAudioContext.webidl b/components/script/dom/webidls/BaseAudioContext.webidl index 9b8d8c5efa1..2883e60ffd8 100644 --- a/components/script/dom/webidls/BaseAudioContext.webidl +++ b/components/script/dom/webidls/BaseAudioContext.webidl @@ -38,7 +38,7 @@ interface BaseAudioContext : EventTarget { [Throws] AnalyserNode createAnalyser(); [Throws] GainNode createGain(); // DelayNode createDelay(optional double maxDelayTime = 1); - // BiquadFilterNode createBiquadFilter(); + [Throws] BiquadFilterNode createBiquadFilter(); // IIRFilterNode createIIRFilter(sequence<double> feedforward, // sequence<double> feedback); // WaveShaperNode createWaveShaper(); diff --git a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini index e9f5094764f..224dbbac2b4 100644 --- a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini +++ b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini @@ -8,9 +8,6 @@ [BaseAudioContext interface: attribute audioWorklet] expected: FAIL - [BaseAudioContext interface: operation createBiquadFilter()] - expected: FAIL - [BaseAudioContext interface: operation createChannelSplitter(unsigned long)] expected: FAIL @@ -89,9 +86,6 @@ [BaseAudioContext interface: context must inherit property "audioWorklet" with the proper type] expected: FAIL - [BaseAudioContext interface: context must inherit property "createBiquadFilter()" with the proper type] - expected: FAIL - [BaseAudioContext interface: context must inherit property "createChannelSplitter(unsigned long)" with the proper type] expected: FAIL @@ -155,9 +149,6 @@ [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "audioWorklet" with the proper type] expected: FAIL - [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createBiquadFilter()" with the proper type] - expected: FAIL - [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createChannelSplitter(unsigned long)" with the proper type] expected: FAIL diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-allpass.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-allpass.html.ini index e5aa83654f5..6ef6c3f2d0b 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-allpass.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-allpass.html.ini @@ -1,2 +1,10 @@ [biquad-allpass.html] - expected: ERROR + [X Max error in Allpass filter response is not less than or equal to 3.9337e-8. Got 2.805464744567871.] + expected: FAIL + + [< [test\] 1 out of 3 assertions were failed.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-automation.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-automation.html.ini index ac3dec84f13..287d87750d4 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-automation.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-automation.html.ini @@ -1,2 +1,2 @@ [biquad-automation.html] - expected: ERROR + expected: CRASH diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-bandpass.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-bandpass.html.ini index fcc3d0f21a5..8bf03b63dd8 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-bandpass.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-bandpass.html.ini @@ -1,2 +1,10 @@ [biquad-bandpass.html] - expected: ERROR + [< [test\] 1 out of 3 assertions were failed.] + expected: FAIL + + [X Max error in Bandpass filter response is not less than or equal to 2.2501e-8. Got 1.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html.ini index bce6dd3eb04..ab13bf5ce1a 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-basic.html.ini @@ -1,8 +1,19 @@ [biquad-basic.html] - expected: ERROR [< [existence\] 1 out of 1 assertions were failed.] expected: FAIL [X context.createBiquadFilter does not exist. Got undefined.] expected: FAIL + [X getFrequencyResponse(new Float32Array(10), new Float32Array(1), new Float32Array(20)) threw "TypeError" instead of InvalidAccessError.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 5 tasks were failed.] + expected: FAIL + + [X getFrequencyResponse(new Float32Array(10), new Float32Array(20), new Float32Array(1)) threw "TypeError" instead of InvalidAccessError.] + expected: FAIL + + [< [exceptions-getFrequencyData\] 2 out of 5 assertions were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass.html.ini index 3e4776a430c..6270a74e10f 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highpass.html.ini @@ -1,2 +1,10 @@ [biquad-highpass.html] - expected: ERROR + [< [test\] 1 out of 3 assertions were failed.] + expected: FAIL + + [X Max error in Highpass filter response is not less than or equal to 1.5487e-8. Got 1.9329860210418701.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highshelf.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highshelf.html.ini index 041e10d010e..9f5e0b56c3b 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highshelf.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-highshelf.html.ini @@ -1,2 +1,10 @@ [biquad-highshelf.html] - expected: ERROR + [< [test\] 1 out of 3 assertions were failed.] + expected: FAIL + + [X Max error in Highshelf filter response is not less than or equal to 6.2577e-8. Got 2.3278465244357536.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-lowpass.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-lowpass.html.ini index a61dc595e90..c92fde14eba 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-lowpass.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-lowpass.html.ini @@ -1,2 +1,10 @@ [biquad-lowpass.html] - expected: ERROR + [< [test\] 1 out of 3 assertions were failed.] + expected: FAIL + + [X Max error in Lowpass filter response is not less than or equal to 9.7869e-8. Got 1.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-lowshelf.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-lowshelf.html.ini index eb11b1317ec..0b0025a76fc 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-lowshelf.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-lowshelf.html.ini @@ -1,2 +1,10 @@ [biquad-lowshelf.html] - expected: ERROR + [< [test\] 1 out of 3 assertions were failed.] + expected: FAIL + + [X Max error in Lowshelf filter response is not less than or equal to 3.8349e-8. Got 3.162277660168379.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-notch.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-notch.html.ini index 29576262c6e..de2ff5cb0c8 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-notch.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-notch.html.ini @@ -1,2 +1,10 @@ [biquad-notch.html] - expected: ERROR + [< [test\] 1 out of 3 assertions were failed.] + expected: FAIL + + [X Max error in Notch filter response is not less than or equal to 1.9669e-8. Got 2.9027323722839355.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-peaking.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-peaking.html.ini index 13f1c9c4824..7b26daf7b82 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-peaking.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquad-peaking.html.ini @@ -1,2 +1,10 @@ [biquad-peaking.html] - expected: ERROR + [< [test\] 1 out of 3 assertions were failed.] + expected: FAIL + + [X Max error in Peaking filter response is not less than or equal to 5.8234e-8. Got 3.162277660168379.] + expected: FAIL + + [# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.] + expected: FAIL + diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquadfilternode-basic.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquadfilternode-basic.html.ini deleted file mode 100644 index 68f54dbc496..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-biquadfilternode-interface/biquadfilternode-basic.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[biquadfilternode-basic.html] - expected: ERROR |