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

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

Issue 2788793004: Convert StereoPanner tests to use new Audit (Closed)
Patch Set: Remove commented-out code Created 3 years, 8 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.html ('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 7af585291952d8a596ee0d80fa3ad9df8f42d1f9..8f71315065550cae04da0164d704c4331d7144fb 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/stereopanner-testing.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/stereopanner-testing.js
@@ -48,11 +48,12 @@ var StereoPannerTest = (function () {
* @param {Object} options.description Test description
* @param {Object} options.numberOfInputChannels Number of input channels
*/
- function Test(options) {
+ function Test(should, options) {
// Primary test flag.
this.success = true;
+ this.should = should;
this.context = null;
this.prefix = options.prefix;
this.numberOfInputChannels = (options.numberOfInputChannels || 1);
@@ -177,46 +178,36 @@ var StereoPannerTest = (function () {
Test.prototype.showResult = function () {
- Should(this.prefix + "Number of impulses found", this.impulseIndex)
+ this.should(this.impulseIndex, this.prefix + "Number of impulses found")
.beEqualTo(gNodesToCreate);
- Should(this.prefix + "Number of impulse at the wrong offset", this.errors.length)
+ this.should(this.errors.length, this.prefix + "Number of impulse at the wrong offset")
.beEqualTo(0);
- Should(this.prefix + "Left channel error magnitude", this.maxErrorL)
+ this.should(this.maxErrorL, this.prefix + "Left channel error magnitude")
.beLessThanOrEqualTo(this.maxAllowedError);
- Should(this.prefix + "Right channel error magnitude", this.maxErrorR)
+ this.should(this.maxErrorR, this.prefix + "Right channel error magnitude")
.beLessThanOrEqualTo(this.maxAllowedError);
};
-
- Test.prototype.finish = function () {
- Should(this.description, this.success)
- .summarize('passed', 'failed');
- };
-
-
- Test.prototype.run = function (done) {
+ Test.prototype.run = function () {
this.init();
this.prepare();
- this.context.oncomplete = function (event) {
- this.renderedBufferL = event.renderedBuffer.getChannelData(0);
- this.renderedBufferR = event.renderedBuffer.getChannelData(1);
- this.verify();
- this.showResult();
- this.finish();
- done();
- }.bind(this);
- this.context.startRendering();
+ return this.context.startRendering()
+ .then(renderedBuffer => {
+ this.renderedBufferL = renderedBuffer.getChannelData(0);
+ this.renderedBufferR = renderedBuffer.getChannelData(1);
+ this.verify();
+ this.showResult();
+ });
};
-
return {
- create: function (options) {
- return new Test(options);
+ create: function (should, options) {
+ return new Test(should, options);
}
};
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/StereoPanner/stereopannernode-panning.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698