diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-09-18 18:59:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-18 18:59:07 -0400 |
commit | a02c43dc67d01c92d184b6a01b4011088b1940c0 (patch) | |
tree | 7eb5d8ce6fa4219b838c9e4c193c532424690f2b | |
parent | 97dc06c3052fdc61c512215d02118266efdf388e (diff) | |
parent | cc32e12d0a78298a4ce9621bec376296eee32a2b (diff) | |
download | servo-a02c43dc67d01c92d184b6a01b4011088b1940c0.tar.gz servo-a02c43dc67d01c92d184b6a01b4011088b1940c0.zip |
Auto merge of #21712 - Manishearth:analysernode, r=ferjm
Implement AnalyserNode
<s>Needs https://github.com/servo/media/pull/127 to land (and a dependency
update)</s>
r? @ferjm
realtimeanalyser-fft-scaling.html, the test that actually checks for some level of FFT correctness, sadly doesn't work since we don't process nodes not connected to the destination.
However I locally fixed the test to work differently and it passed. We'll fix the processing model eventually.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21712)
<!-- Reviewable:end -->
19 files changed, 281 insertions, 204 deletions
diff --git a/Cargo.lock b/Cargo.lock index f4609e1a190..26b04bfb46a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,6 +262,11 @@ dependencies = [ ] [[package]] +name = "boxfnonce" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "brotli" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3274,7 +3279,7 @@ dependencies = [ [[package]] name = "servo-media" version = "0.1.0" -source = "git+https://github.com/servo/media#f52c1c677a757cb8435d9e4c77680473d32c4aab" +source = "git+https://github.com/servo/media#8f65e32617b068e8a0d152236848fd98cc08a3ae" dependencies = [ "servo-media-audio 0.1.0 (git+https://github.com/servo/media)", "servo-media-gstreamer 0.1.0 (git+https://github.com/servo/media)", @@ -3284,12 +3289,15 @@ dependencies = [ [[package]] name = "servo-media-audio" version = "0.1.0" -source = "git+https://github.com/servo/media#f52c1c677a757cb8435d9e4c77680473d32c4aab" +source = "git+https://github.com/servo/media#8f65e32617b068e8a0d152236848fd98cc08a3ae" dependencies = [ + "boxfnonce 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "byte-slice-cast 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", "servo_media_derive 0.1.0 (git+https://github.com/servo/media)", "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3297,7 +3305,7 @@ dependencies = [ [[package]] name = "servo-media-gstreamer" version = "0.1.0" -source = "git+https://github.com/servo/media#f52c1c677a757cb8435d9e4c77680473d32c4aab" +source = "git+https://github.com/servo/media#8f65e32617b068e8a0d152236848fd98cc08a3ae" dependencies = [ "byte-slice-cast 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3315,7 +3323,7 @@ dependencies = [ [[package]] name = "servo-media-player" version = "0.1.0" -source = "git+https://github.com/servo/media#f52c1c677a757cb8435d9e4c77680473d32c4aab" +source = "git+https://github.com/servo/media#8f65e32617b068e8a0d152236848fd98cc08a3ae" dependencies = [ "ipc-channel 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3410,7 +3418,7 @@ dependencies = [ [[package]] name = "servo_media_derive" version = "0.1.0" -source = "git+https://github.com/servo/media#f52c1c677a757cb8435d9e4c77680473d32c4aab" +source = "git+https://github.com/servo/media#8f65e32617b068e8a0d152236848fd98cc08a3ae" dependencies = [ "quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4350,6 +4358,7 @@ dependencies = [ "checksum blurmac 0.1.0 (git+https://github.com/servo/devices)" = "<none>" "checksum blurmock 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "68dd72da3a3bb40f3d3bdd366c4cf8e2b1d208c366304f382c80cef8126ca8da" "checksum blurz 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e73bda0f4c71c63a047351070097f3f507e6718e86b9ee525173371ef7b94b73" +"checksum boxfnonce 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbec60c560f322d8e3cd403f91d8908cfd965fff53ba97154bd1b9d90149d98e" "checksum brotli 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fe87b40996b84fdc56e57c165d93079f4b50cb806598118e692ddfaa3d3c57c0" "checksum brotli-decompressor 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "313f4b6cc0b365d6b88eda5aa40175ee34ac6efa9a79e0b3b8202eca90247ba8" "checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" diff --git a/components/script/dom/analysernode.rs b/components/script/dom/analysernode.rs new file mode 100644 index 00000000000..27f2f27b386 --- /dev/null +++ b/components/script/dom/analysernode.rs @@ -0,0 +1,218 @@ +/* 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 http://mozilla.org/MPL/2.0/. */ + +use dom::audionode::AudioNode; +use dom::baseaudiocontext::BaseAudioContext; +use dom::bindings::cell::DomRefCell; +use dom::bindings::codegen::Bindings::AnalyserNodeBinding::{self, AnalyserNodeMethods, AnalyserOptions}; +use dom::bindings::codegen::Bindings::AudioNodeBinding::{ChannelCountMode, ChannelInterpretation}; +use dom::bindings::error::{Error, Fallible}; +use dom::bindings::num::Finite; +use dom::bindings::refcounted::Trusted; +use dom::bindings::reflector::reflect_dom_object; +use dom::bindings::root::DomRoot; +use dom::window::Window; +use dom_struct::dom_struct; +use ipc_channel::ipc::{self, IpcReceiver}; +use ipc_channel::router::ROUTER; +use js::rust::CustomAutoRooterGuard; +use js::typedarray::{Float32Array, Uint8Array}; +use servo_media::audio::analyser_node::AnalysisEngine; +use servo_media::audio::block::Block; +use servo_media::audio::node::AudioNodeInit; +use task_source::{TaskSource, TaskSourceName}; + +#[dom_struct] +pub struct AnalyserNode { + node: AudioNode, + #[ignore_malloc_size_of = "Defined in servo-media"] + engine: DomRefCell<AnalysisEngine>, +} + +impl AnalyserNode { + #[allow(unrooted_must_root)] + pub fn new_inherited( + _: &Window, + context: &BaseAudioContext, + options: &AnalyserOptions, + ) -> Fallible<(AnalyserNode, IpcReceiver<Block>)> { + let node_options = options.parent + .unwrap_or(2, ChannelCountMode::Max, + ChannelInterpretation::Speakers); + + if options.fftSize > 32768 || options.fftSize < 32 || + (options.fftSize & (options.fftSize - 1) != 0) { + return Err(Error::IndexSize) + } + + if *options.maxDecibels <= *options.minDecibels { + return Err(Error::IndexSize) + } + + if *options.smoothingTimeConstant < 0. || *options.smoothingTimeConstant > 1. { + return Err(Error::IndexSize); + } + + let (send, rcv) = ipc::channel().unwrap(); + let callback = move |block| { + send.send(block).unwrap(); + }; + + let node = AudioNode::new_inherited( + AudioNodeInit::AnalyserNode(Box::new(callback)), + context, + node_options, + 1, // inputs + 1, // outputs + )?; + + + let engine = AnalysisEngine::new(options.fftSize as usize, + *options.smoothingTimeConstant, + *options.minDecibels, *options.maxDecibels); + Ok((AnalyserNode { + node, + engine: DomRefCell::new(engine) + }, rcv)) + } + + #[allow(unrooted_must_root)] + pub fn new( + window: &Window, + context: &BaseAudioContext, + options: &AnalyserOptions, + ) -> Fallible<DomRoot<AnalyserNode>> { + let (node, recv) = AnalyserNode::new_inherited(window, context, options)?; + let object = reflect_dom_object(Box::new(node), window, AnalyserNodeBinding::Wrap); + let source = window.dom_manipulation_task_source(); + let canceller = window.task_canceller(TaskSourceName::DOMManipulation); + let this = Trusted::new(&*object); + + ROUTER.add_route(recv.to_opaque(), Box::new(move |block| { + let this = this.clone(); + let _ = source.queue_with_canceller(task!(append_analysis_block: move || { + let this = this.root(); + this.push_block(block.to().unwrap()) + }), &canceller); + })); + Ok(object) + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-analysernode + pub fn Constructor( + window: &Window, + context: &BaseAudioContext, + options: &AnalyserOptions, + ) -> Fallible<DomRoot<AnalyserNode>> { + AnalyserNode::new(window, context, options) + } + + pub fn push_block(&self, block: Block) { + self.engine.borrow_mut().push(block) + } +} + +impl AnalyserNodeMethods for AnalyserNode { + #[allow(unsafe_code)] + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-getfloatfrequencydata + fn GetFloatFrequencyData(&self, mut array: CustomAutoRooterGuard<Float32Array>) { + // Invariant to maintain: No JS code that may touch the array should + // run whilst we're writing to it + let dest = unsafe { array.as_mut_slice() }; + self.engine.borrow_mut().fill_frequency_data(dest); + } + + #[allow(unsafe_code)] + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-getbytefrequencydata + fn GetByteFrequencyData(&self, mut array: CustomAutoRooterGuard<Uint8Array>) { + // Invariant to maintain: No JS code that may touch the array should + // run whilst we're writing to it + let dest = unsafe { array.as_mut_slice() }; + self.engine.borrow_mut().fill_byte_frequency_data(dest); + + } + + #[allow(unsafe_code)] + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-getfloattimedomaindata + fn GetFloatTimeDomainData(&self, mut array: CustomAutoRooterGuard<Float32Array>) { + // Invariant to maintain: No JS code that may touch the array should + // run whilst we're writing to it + let dest = unsafe { array.as_mut_slice() }; + self.engine.borrow().fill_time_domain_data(dest); + + } + + #[allow(unsafe_code)] + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-getbytetimedomaindata + fn GetByteTimeDomainData(&self, mut array: CustomAutoRooterGuard<Uint8Array>) { + // Invariant to maintain: No JS code that may touch the array should + // run whilst we're writing to it + let dest = unsafe { array.as_mut_slice() }; + self.engine.borrow().fill_byte_time_domain_data(dest); + + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-fftsize + fn SetFftSize(&self, value: u32) -> Fallible<()> { + if value > 32768 || value < 32 || + (value & (value - 1) != 0) { + return Err(Error::IndexSize) + } + self.engine.borrow_mut().set_fft_size(value as usize); + Ok(()) + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-fftsize + fn FftSize(&self) -> u32 { + self.engine.borrow().get_fft_size() as u32 + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-frequencybincount + fn FrequencyBinCount(&self) -> u32 { + self.FftSize() / 2 + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-mindecibels + fn MinDecibels(&self) -> Finite<f64> { + Finite::wrap(self.engine.borrow().get_min_decibels()) + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-mindecibels + fn SetMinDecibels(&self, value: Finite<f64>) -> Fallible<()> { + if *value >= self.engine.borrow().get_max_decibels() { + return Err(Error::IndexSize) + } + self.engine.borrow_mut().set_min_decibels(*value); + Ok(()) + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-maxdecibels + fn MaxDecibels(&self) -> Finite<f64> { + Finite::wrap(self.engine.borrow().get_max_decibels()) + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-maxdecibels + fn SetMaxDecibels(&self, value: Finite<f64>) -> Fallible<()> { + if *value <= self.engine.borrow().get_min_decibels() { + return Err(Error::IndexSize) + } + self.engine.borrow_mut().set_max_decibels(*value); + Ok(()) + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-smoothingtimeconstant + fn SmoothingTimeConstant(&self) -> Finite<f64> { + Finite::wrap(self.engine.borrow().get_smoothing_constant()) + } + + /// https://webaudio.github.io/web-audio-api/#dom-analysernode-smoothingtimeconstant + fn SetSmoothingTimeConstant(&self, value: Finite<f64>) -> Fallible<()> { + if *value < 0. || *value > 1. { + return Err(Error::IndexSize) + } + self.engine.borrow_mut().set_smoothing_constant(*value); + Ok(()) + } +} + diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs index dbd821b64fe..514a51f113b 100644 --- a/components/script/dom/baseaudiocontext.rs +++ b/components/script/dom/baseaudiocontext.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use dom::analysernode::AnalyserNode; use dom::audiobuffer::AudioBuffer; use dom::audiobuffersourcenode::AudioBufferSourceNode; use dom::audiodestinationnode::AudioDestinationNode; @@ -9,6 +10,7 @@ use dom::audiolistener::AudioListener; use dom::audionode::MAX_CHANNEL_COUNT; use dom::bindings::callback::ExceptionHandling; use dom::bindings::cell::DomRefCell; +use dom::bindings::codegen::Bindings::AnalyserNodeBinding::AnalyserOptions; use dom::bindings::codegen::Bindings::AudioBufferSourceNodeBinding::AudioBufferSourceOptions; use dom::bindings::codegen::Bindings::AudioNodeBinding::{ChannelCountMode, ChannelInterpretation}; use dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions; @@ -337,6 +339,11 @@ impl BaseAudioContextMethods for BaseAudioContext { PannerNode::new(&self.global().as_window(), &self, &PannerOptions::empty()) } + /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createanalyser + fn CreateAnalyser(&self) -> Fallible<DomRoot<AnalyserNode>> { + AnalyserNode::new(&self.global().as_window(), &self, &AnalyserOptions::empty()) + } + /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelmerger fn CreateChannelMerger(&self, count: u32) -> Fallible<DomRoot<ChannelMergerNode>> { let mut opts = ChannelMergerOptions::empty(); diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 33cd3e02b55..ca01ff600d8 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -90,6 +90,7 @@ use servo_arc::Arc as ServoArc; use servo_atoms::Atom; use servo_channel::{Receiver, Sender}; use servo_media::Backend; +use servo_media::audio::analyser_node::AnalysisEngine; use servo_media::audio::buffer_source_node::AudioBuffer; use servo_media::audio::context::AudioContext; use servo_media::audio::graph::NodeId; @@ -435,7 +436,7 @@ unsafe_no_jsmanaged_fields!(SourceSet); unsafe_no_jsmanaged_fields!(AudioBuffer); unsafe_no_jsmanaged_fields!(AudioContext<Backend>); unsafe_no_jsmanaged_fields!(NodeId); -unsafe_no_jsmanaged_fields!(DistanceModel, PanningModel, ParamType); +unsafe_no_jsmanaged_fields!(AnalysisEngine, DistanceModel, PanningModel, ParamType); unsafe impl<'a> JSTraceable for &'a str { #[inline] diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index 04a234a80d3..54b9adcc422 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -215,6 +215,7 @@ pub mod types { pub mod abstractworker; pub mod abstractworkerglobalscope; pub mod activation; +pub mod analysernode; pub mod attr; pub mod audiobuffer; pub mod audiobuffersourcenode; diff --git a/components/script/dom/webidls/AnalyserNode.webidl b/components/script/dom/webidls/AnalyserNode.webidl new file mode 100644 index 00000000000..b9b04ab487c --- /dev/null +++ b/components/script/dom/webidls/AnalyserNode.webidl @@ -0,0 +1,28 @@ +/* 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 http://mozilla.org/MPL/2.0/. */ +/* + * The origin of this IDL file is + * https://webaudio.github.io/web-audio-api/#analysernode + */ + +dictionary AnalyserOptions : AudioNodeOptions { + unsigned long fftSize = 2048; + double maxDecibels = -30; + double minDecibels = -100; + double smoothingTimeConstant = 0.8; +}; + +[Exposed=Window, + Constructor (BaseAudioContext context, optional AnalyserOptions options)] +interface AnalyserNode : AudioNode { + void getFloatFrequencyData (Float32Array array); + void getByteFrequencyData (Uint8Array array); + void getFloatTimeDomainData (Float32Array array); + void getByteTimeDomainData (Uint8Array array); + [SetterThrows] attribute unsigned long fftSize; + readonly attribute unsigned long frequencyBinCount; + [SetterThrows] attribute double minDecibels; + [SetterThrows] attribute double maxDecibels; + [SetterThrows] attribute double smoothingTimeConstant; +}; diff --git a/components/script/dom/webidls/BaseAudioContext.webidl b/components/script/dom/webidls/BaseAudioContext.webidl index f8b85007a64..9b8d8c5efa1 100644 --- a/components/script/dom/webidls/BaseAudioContext.webidl +++ b/components/script/dom/webidls/BaseAudioContext.webidl @@ -35,7 +35,7 @@ interface BaseAudioContext : EventTarget { // ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0, // optional unsigned long numberOfInputChannels = 2, // optional unsigned long numberOfOutputChannels = 2); - // AnalyserNode createAnalyser(); + [Throws] AnalyserNode createAnalyser(); [Throws] GainNode createGain(); // DelayNode createDelay(optional double maxDelayTime = 1); // BiquadFilterNode createBiquadFilter(); diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 5a3ffb644d8..c7c228e408a 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -658118,7 +658118,7 @@ "support" ], "webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html": [ - "4e27f842ddeda3e2bdd78da7b8ee3f67062d1a9f", + "a9aa4831516c6a5cefa7c8b4f67f3ef246d24777", "testharness" ], "webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-basic.html": [ @@ -658150,7 +658150,7 @@ "testharness" ], "webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html": [ - "52d3829cff3dfceef64a34669bc8e0d6e08883a9", + "a8b5a7154e94479460c1085c6b5cb584e9b6976c", "testharness" ], "webaudio/the-audio-api/the-audiobuffer-interface/.gitkeep": [ diff --git a/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini b/tests/wpt/metadata/webaudio/idlharness.https.window.js.ini index 4114b54f0a6..50e3231ac0c 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 createAnalyser()] - expected: FAIL - [BaseAudioContext interface: operation createBiquadFilter()] expected: FAIL @@ -92,9 +89,6 @@ [BaseAudioContext interface: context must inherit property "audioWorklet" with the proper type] expected: FAIL - [BaseAudioContext interface: context must inherit property "createAnalyser()" with the proper type] - expected: FAIL - [BaseAudioContext interface: context must inherit property "createBiquadFilter()" with the proper type] expected: FAIL @@ -161,9 +155,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 "createAnalyser()" with the proper type] - expected: FAIL - [BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createBiquadFilter()" with the proper type] expected: FAIL @@ -224,165 +215,6 @@ [AudioParam interface: calling setValueCurveAtTime([object Object\], double, double) on new AudioBufferSourceNode(context).playbackRate with too few arguments must throw TypeError] expected: FAIL - [AnalyserNode interface: existence and properties of interface object] - expected: FAIL - - [AnalyserNode interface object length] - expected: FAIL - - [AnalyserNode interface object name] - expected: FAIL - - [AnalyserNode interface: existence and properties of interface prototype object] - expected: FAIL - - [AnalyserNode interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL - - [AnalyserNode interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL - - [AnalyserNode interface: operation getFloatFrequencyData(Float32Array)] - expected: FAIL - - [AnalyserNode interface: operation getByteFrequencyData(Uint8Array)] - expected: FAIL - - [AnalyserNode interface: operation getFloatTimeDomainData(Float32Array)] - expected: FAIL - - [AnalyserNode interface: operation getByteTimeDomainData(Uint8Array)] - expected: FAIL - - [AnalyserNode interface: attribute fftSize] - expected: FAIL - - [AnalyserNode interface: attribute frequencyBinCount] - expected: FAIL - - [AnalyserNode interface: attribute minDecibels] - expected: FAIL - - [AnalyserNode interface: attribute maxDecibels] - expected: FAIL - - [AnalyserNode interface: attribute smoothingTimeConstant] - expected: FAIL - - [AnalyserNode must be primary interface of new AnalyserNode(context)] - expected: FAIL - - [Stringification of new AnalyserNode(context)] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "getFloatFrequencyData(Float32Array)" with the proper type] - expected: FAIL - - [AnalyserNode interface: calling getFloatFrequencyData(Float32Array) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "getByteFrequencyData(Uint8Array)" with the proper type] - expected: FAIL - - [AnalyserNode interface: calling getByteFrequencyData(Uint8Array) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "getFloatTimeDomainData(Float32Array)" with the proper type] - expected: FAIL - - [AnalyserNode interface: calling getFloatTimeDomainData(Float32Array) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "getByteTimeDomainData(Uint8Array)" with the proper type] - expected: FAIL - - [AnalyserNode interface: calling getByteTimeDomainData(Uint8Array) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "fftSize" with the proper type] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "frequencyBinCount" with the proper type] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "minDecibels" with the proper type] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "maxDecibels" with the proper type] - expected: FAIL - - [AnalyserNode interface: new AnalyserNode(context) must inherit property "smoothingTimeConstant" with the proper type] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "connect(AudioNode, unsigned long, unsigned long)" with the proper type] - expected: FAIL - - [AudioNode interface: calling connect(AudioNode, unsigned long, unsigned long) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "connect(AudioParam, unsigned long)" with the proper type] - expected: FAIL - - [AudioNode interface: calling connect(AudioParam, unsigned long) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "disconnect()" with the proper type] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "disconnect(unsigned long)" with the proper type] - expected: FAIL - - [AudioNode interface: calling disconnect(unsigned long) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "disconnect(AudioNode)" with the proper type] - expected: FAIL - - [AudioNode interface: calling disconnect(AudioNode) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type] - expected: FAIL - - [AudioNode interface: calling disconnect(AudioNode, unsigned long) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type] - expected: FAIL - - [AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "disconnect(AudioParam)" with the proper type] - expected: FAIL - - [AudioNode interface: calling disconnect(AudioParam) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type] - expected: FAIL - - [AudioNode interface: calling disconnect(AudioParam, unsigned long) on new AnalyserNode(context) with too few arguments must throw TypeError] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "context" with the proper type] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "numberOfInputs" with the proper type] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "numberOfOutputs" with the proper type] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "channelCount" with the proper type] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "channelCountMode" with the proper type] - expected: FAIL - - [AudioNode interface: new AnalyserNode(context) must inherit property "channelInterpretation" with the proper type] - expected: FAIL - [AudioListener interface: operation setPosition(float, float, float)] expected: FAIL diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html.ini deleted file mode 100644 index decbfc1cb82..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[ctor-analyser.html] - expected: ERROR - [X node0 = new AnalyserNode(context) incorrectly threw TypeError: "window[name\] is not a constructor".] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-basic.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-basic.html.ini deleted file mode 100644 index f48362f4d5c..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-basic.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[realtimeanalyser-basic.html] - expected: ERROR diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini index 75d8cd648df..dfc61af48f0 100644 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini +++ b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html.ini @@ -1,2 +1,2 @@ [realtimeanalyser-fft-scaling.html] - expected: ERROR + expected: TIMEOUT diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-sizing.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-sizing.html.ini deleted file mode 100644 index 6e6b8e650d1..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-sizing.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[realtimeanalyser-fft-sizing.html] - expected: ERROR diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/test-analyser-scale.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/test-analyser-scale.html.ini deleted file mode 100644 index 85616419537..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/test-analyser-scale.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[test-analyser-scale.html] - [Test AnalyserNode when the input is scaled] - expected: FAIL - diff --git a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html.ini b/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html.ini deleted file mode 100644 index 6992ca5707d..00000000000 --- a/tests/wpt/metadata/webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html.ini +++ /dev/null @@ -1,7 +0,0 @@ -[test-analysernode.html] - [Test AnalyserNode's ctor API] - expected: FAIL - - [Test AnalyserNode API] - expected: FAIL - diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index d89b2751d7f..3388ffd2562 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -27038,7 +27038,7 @@ "testharness" ], "mozilla/interfaces.html": [ - "d48b52d06eaa76167fb8bc2c23f2410ec74ba247", + "840c233a14c3d041e43a125a6d1452670aa4fbb4", "testharness" ], "mozilla/interfaces.js": [ diff --git a/tests/wpt/mozilla/tests/mozilla/interfaces.html b/tests/wpt/mozilla/tests/mozilla/interfaces.html index d48b52d06ea..840c233a14c 100644 --- a/tests/wpt/mozilla/tests/mozilla/interfaces.html +++ b/tests/wpt/mozilla/tests/mozilla/interfaces.html @@ -11,6 +11,7 @@ // IMPORTANT: Do not change the list below without review from a DOM peer! test_interfaces([ + "AnalyserNode", "Attr", "AudioBuffer", "AudioBufferSourceNode", diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html index 4e27f842dde..a9aa4831516 100644 --- a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser.html @@ -32,7 +32,7 @@ prefix: prefix, numberOfInputs: 1, numberOfOutputs: 1, - channelCount: 1, + channelCount: 2, channelCountMode: 'max', channelInterpretation: 'speakers' }); diff --git a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html index 52d3829cff3..a8b5a7154e9 100644 --- a/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html +++ b/tests/wpt/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html @@ -27,8 +27,8 @@ assert_equals( analyser.channelCount, - 1, - "analyser node has 1 input channels by default" + 2, + "analyser node has 2 input channels by default" ); assert_equals( analyser.channelCountMode, @@ -131,8 +131,8 @@ var analyser = new AnalyserNode(context); assert_equals( analyser.channelCount, - 1, - "analyser node has 1 input channels by default" + 2, + "analyser node has 2 input channels by default" ); assert_equals( analyser.channelCountMode, |