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 -->
This commit is contained in:
bors-servo 2018-09-18 18:59:07 -04:00 committed by GitHub
commit a02c43dc67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 281 additions and 204 deletions

19
Cargo.lock generated
View file

@ -261,6 +261,11 @@ dependencies = [
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "boxfnonce"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "brotli"
version = "1.1.2"
@ -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"

View file

@ -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(())
}
}

View file

@ -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();

View file

@ -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]

View file

@ -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;

View file

@ -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;
};

View file

@ -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();

View file

@ -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": [

View file

@ -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

View file

@ -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

View file

@ -1,2 +0,0 @@
[realtimeanalyser-basic.html]
expected: ERROR

View file

@ -1,2 +1,2 @@
[realtimeanalyser-fft-scaling.html]
expected: ERROR
expected: TIMEOUT

View file

@ -1,2 +0,0 @@
[realtimeanalyser-fft-sizing.html]
expected: ERROR

View file

@ -1,4 +0,0 @@
[test-analyser-scale.html]
[Test AnalyserNode when the input is scaled]
expected: FAIL

View file

@ -1,7 +0,0 @@
[test-analysernode.html]
[Test AnalyserNode's ctor API]
expected: FAIL
[Test AnalyserNode API]
expected: FAIL

View file

@ -27038,7 +27038,7 @@
"testharness"
],
"mozilla/interfaces.html": [
"d48b52d06eaa76167fb8bc2c23f2410ec74ba247",
"840c233a14c3d041e43a125a6d1452670aa4fbb4",
"testharness"
],
"mozilla/interfaces.js": [

View file

@ -11,6 +11,7 @@
// IMPORTANT: Do not change the list below without review from a DOM peer!
test_interfaces([
"AnalyserNode",
"Attr",
"AudioBuffer",
"AudioBufferSourceNode",

View file

@ -32,7 +32,7 @@
prefix: prefix,
numberOfInputs: 1,
numberOfOutputs: 1,
channelCount: 1,
channelCount: 2,
channelCountMode: 'max',
channelInterpretation: 'speakers'
});

View file

@ -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,