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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/audit-util.js

Issue 2593043003: Convert AudioBufferSource tests using Audit to testharness (Closed)
Patch Set: Missed a couple testFailed calls. Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/resources/audiobuffersource-testing.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/resources/audit-util.js
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/audit-util.js b/third_party/WebKit/LayoutTests/webaudio/resources/audit-util.js
index 112d75acb7f4902b3b8209b9b1ccbaaa156782d6..3e261f6d7ad025eb3d21d5b3784d6959d62e6612 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/audit-util.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/audit-util.js
@@ -159,29 +159,13 @@ function compareBuffersWithConstraints(actual, expected, options) {
var snr = 10 * Math.log10(signalPower / noisePower);
var maxErrorULP = maxError * scaleFactor;
- if (snr >= thresholdSNR) {
- testPassed('Exceeded SNR threshold of ' + thresholdSNR + ' dB.');
- } else {
- testFailed('Expected SNR of ' + thresholdSNR + ' dB, but actual SNR is ' +
- snr + ' dB.');
- }
+ Should("SNR", snr).beGreaterThanOrEqualTo(thresholdSNR);
- if (maxErrorULP <= thresholdDiffULP) {
- testPassed('Maximum difference below threshold of ' +
- thresholdDiffULP + ' ulp (' + bitDepth + '-bits).');
- } else {
- testFailed('Maximum difference of ' + maxErrorULP +
- ' at the index ' + errorPosition + ' exceeded threshold of ' +
- thresholdDiffULP + ' ulp (' + bitDepth + '-bits).');
- }
+ Should('Maximum difference (in ulp units (' + bitDepth + '-bits))',
+ maxErrorULP).beLessThanOrEqualTo(thresholdDiffULP);
- if (diffCount <= thresholdDiffCount) {
- testPassed('Number of differences between results is ' +
- diffCount + ' out of ' + actual.length + '.');
- } else {
- testFailed(diffCount + ' differences found but expected no more than ' +
- diffCount + ' out of ' + actual.length + '.');
- }
+ Should('Number of differences between results', diffCount)
+ .beLessThanOrEqualTo(thresholdDiffCount);
}
// Create an impulse in a buffer of length sampleFrameLength
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/resources/audiobuffersource-testing.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698