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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-downmix.html

Issue 2777983002: Convert Analyser tests to use new Audit. (Closed)
Patch Set: Remove console.logs Created 3 years, 9 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/Analyser/realtimeanalyser-downmix.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-downmix.html b/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-downmix.html
index 6354f3c6d3f5133f1e5914b73a150cebc8e0f36e..8ff8318e9b9e3d4058d4eb47948e2634c5df7777 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-downmix.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-downmix.html
@@ -4,7 +4,7 @@
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../resources/audit-util.js"></script>
- <script src="../resources/audio-testing.js"></script>
+ <script src="../resources/audit.js"></script>
<script src="../resources/fft.js"></script>
<script src="../resources/realtimeanalyser-testing.js"></script>
<title>Test AnalyserNode Downmixing</title>
@@ -41,23 +41,19 @@
// Create tasks for each entry in testConfigs
for (k in testConfigs) {
- audit.defineTask(testConfigs[k].message, (function (config) {
- return function(done) {
- runTest(config).then(done);
+ audit.define(testConfigs[k].message, (function (config) {
+ return function(task, should) {
+ runTest(config, should).then(() => task.done());
};
})(testConfigs[k]));
}
- audit.defineTask("finish", function (done) {
- done();
- });
-
- audit.runTasks();
+ audit.run();
// Test downmixing of the AnalyserNode time data. We use the downmixing that automatically
// happens in the destination node to generate the reference data which is compared to the
// data that the Analyser node has captured.
- function runTest(options) {
+ function runTest(options, should) {
// Context MUST have exactly one channel so that we downmix the source to mono to generate
// the reference.
var context = new OfflineAudioContext(1, renderFrames, sampleRate);
@@ -99,21 +95,18 @@
// Verify the time domain data is correct.
var prefix = "Analyser downmix " + options.message + " to mono"
- success = Should(prefix + " time data", timeData)
+ should(timeData, prefix + " time data")
.beEqualToArray(renderedBuffer.getChannelData(0).subarray(0, analyser.fftSize));
var expectedTimeData = renderedBuffer.getChannelData(0).subarray(0, analyser.fftSize);
var fftOrder = Math.floor(Math.log2(analyser.fftSize));
var expectedFreqData = computeFFTMagnitude(expectedTimeData, fftOrder).map(linearToDb);
- success = compareFloatFreq(prefix + " freq data", freqData, expectedFreqData, {
+ var success = compareFloatFreq(prefix + " freq data", freqData,
+ expectedFreqData, should, {
precision: 6,
floatRelError: options.floatRelError,
- }) && success;
-
- Should(prefix, success)
- .summarize("downmixed correctly.",
- "no downmixed correctly.");
+ });
});
}
</script>

Powered by Google App Engine
This is Rietveld 408576698