Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js

Issue 1885723003: Implement Biquad lowpass and highpass filters according to spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js b/third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js
index 7c72a4702ba4d0c55177fe773fc691fea20cf7e9..dea7b1cbb5a1487a81135494df171883eeab1182 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js
@@ -40,7 +40,7 @@ function createImpulseBuffer(context, length) {
}
-function createTestAndRun(context, filterType, filterParameters) {
+function createTestAndRun(context, filterType, testParameters) {
// To test the filters, we apply a signal (an impulse) to each of
// the specified filters, with each signal starting at a different
// time. The output of the filters is summed together at the
@@ -49,7 +49,8 @@ function createTestAndRun(context, filterType, filterParameters) {
// must be large enough for the output of each filter to have
// decayed to zero with timeStep seconds. That way the filter
// outputs don't interfere with each other.
-
+
+ var filterParameters = testParameters.filterParameters;
nFilters = Math.min(filterParameters.length, maxFilters);
signal = new Array(nFilters);
@@ -75,7 +76,7 @@ function createTestAndRun(context, filterType, filterParameters) {
signal[k].start(timeStep * k);
}
- context.oncomplete = checkFilterResponse(filterType, filterParameters);
+ context.oncomplete = checkFilterResponse(filterType, testParameters);
context.startRendering();
}
@@ -115,8 +116,10 @@ function generateReference(filterType, filterParameters) {
return result;
}
-function checkFilterResponse(filterType, filterParameters) {
+function checkFilterResponse(filterType, testParameters) {
return function(event) {
+ var filterParameters = testParameters.filterParameters;
+ var maxAllowedError = testParameters.threshold;
renderedBuffer = event.renderedBuffer;
renderedData = renderedBuffer.getChannelData(0);

Powered by Google App Engine
This is Rietveld 408576698