mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 1408456 - Convert test_analyserNodeMinimum.html to a web-platform-test: test-analyser-minimum.html. r=karlt
MozReview-Commit-ID: F6VNiYBXr7Z --HG-- rename : dom/media/webaudio/test/test_analyserNodeMinimum.html => testing/web-platform/tests/webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html extra : rebase_source : 4258a557e1bf07e0b1f0cbb3b2e517b2a3c56da9
This commit is contained in:
parent
fd0d5e5373
commit
23732e9bcc
@ -40,6 +40,7 @@ skip-if = !asan || toolkit != android
|
||||
[test_analyserNodeWithGain.html]
|
||||
skip-if = !asan || toolkit != android
|
||||
[test_analyserNodeMinimum.html]
|
||||
skip-if = !asan || toolkit != android
|
||||
[test_AudioBuffer.html]
|
||||
[test_audioBufferSourceNode.html]
|
||||
[test_audioBufferSourceNodeEnded.html]
|
||||
|
@ -380099,6 +380099,12 @@
|
||||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html": [
|
||||
[
|
||||
"/webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"webaudio/the-audio-api/the-analysernode-interface/test-analyser-scale.html": [
|
||||
[
|
||||
"/webaudio/the-audio-api/the-analysernode-interface/test-analyser-scale.html",
|
||||
@ -631628,6 +631634,10 @@
|
||||
"c3f5f5969ed0ab58a9df332196e138aef8e693f3",
|
||||
"testharness"
|
||||
],
|
||||
"webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html": [
|
||||
"cfbeb7283e7375974943ccf689cca73942e6259f",
|
||||
"testharness"
|
||||
],
|
||||
"webaudio/the-audio-api/the-analysernode-interface/test-analyser-scale.html": [
|
||||
"1909a2970f0529ad0433c8e6e75733695d44d3e0",
|
||||
"testharness"
|
||||
|
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test AnalyserNode when the input is silent</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
||||
var ac = new AudioContext();
|
||||
var analyser = ac.createAnalyser();
|
||||
var constant = ac.createConstantSource();
|
||||
var sp = ac.createScriptProcessor(2048, 1, 0);
|
||||
|
||||
constant.offset.value = 0.0;
|
||||
|
||||
constant.connect(analyser).connect(ac.destination);
|
||||
|
||||
constant.connect(sp);
|
||||
|
||||
var buf = new Float32Array(analyser.frequencyBinCount);
|
||||
var iteration_count = 10;
|
||||
sp.onaudioprocess = function() {
|
||||
analyser.getFloatFrequencyData(buf);
|
||||
var correct = true;
|
||||
for (var i = 0; i < buf.length; i++) {
|
||||
correct &= buf[i] == -Infinity;
|
||||
}
|
||||
assert_true(!!correct, "silent input process -Infinity in decibel bins");
|
||||
if (!iteration_count--) {
|
||||
sp.onaudioprocess = null;
|
||||
constant.stop();
|
||||
ac.close();
|
||||
done();
|
||||
}
|
||||
};
|
||||
|
||||
constant.start();
|
||||
</script>
|
||||
</head>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user