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

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,