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

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

Issue 2695113003: Convert StereoPanner Audit tests to testharness (Closed)
Patch Set: Fix typo Created 3 years, 10 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/StereoPanner/stereopannernode-panning-expected.txt ('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/stereopanner-testing.js
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/stereopanner-testing.js b/third_party/WebKit/LayoutTests/webaudio/resources/stereopanner-testing.js
index 60d947b4a9b9ac0d198ce995ad825af370167c88..0e573e9650ec7569b4712bd1b6a4ea54306fddcb 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/stereopanner-testing.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/stereopanner-testing.js
@@ -176,59 +176,23 @@ var StereoPannerTest = (function () {
Test.prototype.showResult = function () {
- if (this.impulseIndex === gNodesToCreate) {
- testPassed('Number of impulses matches the number of panner nodes.');
- } else {
- testFailed('Number of impulses is incorrect. (Found '
- + this.impulseIndex
- + ' but expected '
- + gNodesToCreate
- + ')'
- );
- this.success = false;
- }
+ Should("Number of impulses found", this.impulseIndex)
+ .beEqualTo(gNodesToCreate);
- if (this.errors.length === 0) {
- testPassed('All impulses at expected offsets.');
- } else {
- testFailed(this.errors.length + ' timing errors found in '
- + this.nodesToCreate + ' panner nodes.'
- );
- for (var i = 0; i < this.errors.length; i++) {
- testFailed('Impulse at sample ' + this.errors[i].actual
- + ' but expected ' + this.errors[i].expected
- );
- }
- this.success = false;
- }
+ Should("Number of impulse at the wrong offset", this.errors.length)
+ .beEqualTo(0);
- if (this.maxErrorL <= this.maxAllowedError) {
- testPassed('Left channel gain values are correct.');
- } else {
- testFailed('Left channel gain values are incorrect. Max error = '
- + this.maxErrorL + ' at time ' + this.onsets[this.maxErrorIndexL]
- + ' (threshold = ' + this.maxAllowedError + ')'
- );
- this.success = false;
- }
+ Should("Left channel error magnitude", this.maxErrorL)
+ .beLessThanOrEqualTo(this.maxAllowedError);
- if (this.maxErrorR <= this.maxAllowedError) {
- testPassed('Right channel gain values are correct.');
- } else {
- testFailed('Right channel gain values are incorrect. Max error = '
- + this.maxErrorR + ' at time ' + this.onsets[this.maxErrorIndexR]
- + ' (threshold = ' + this.maxAllowedError + ')'
- );
- this.success = false;
- }
+ Should("Right channel error magnitude", this.maxErrorR)
+ .beLessThanOrEqualTo(this.maxAllowedError);
};
Test.prototype.finish = function () {
- if (this.success)
- testPassed(this.description + ': passed.');
- else
- testFailed(this.description + ': failed.');
+ Should(this.description, this.success)
+ .summarize('passed', 'failed');
};
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/StereoPanner/stereopannernode-panning-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698