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

Unified Diff: LayoutTests/webaudio/resources/audio-testing.js

Issue 1140723003: Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Initial review + layout tests Created 5 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: LayoutTests/webaudio/resources/audio-testing.js
diff --git a/LayoutTests/webaudio/resources/audio-testing.js b/LayoutTests/webaudio/resources/audio-testing.js
index c4a791ce57a2cfcb567a4a8bc112c9ba4f1e8c91..c8290a1c4d688fa70a090a872275a2f72474fbdd 100644
--- a/LayoutTests/webaudio/resources/audio-testing.js
+++ b/LayoutTests/webaudio/resources/audio-testing.js
@@ -631,6 +631,34 @@ var Should = (function () {
this._testPassed('has no glitch above the threshold of ' + threshold);
};
+ // Check if the target promise is resolved correctly.
+ //
+ // Example:
+ // Should('My promise', promise).beResolved().then(nextStuff);
+ // Result:
+ // "PASS My promise resolved correctly."
+ ShouldModel.prototype.beResolved = function () {
+ return this.target.then(function () {
+ this._testPassed('resolved correctly');
+ }.bind(this), function (err) {
+ this._testFailed('resolved correctly. (with ' + err + ')');
Raymond Toy 2015/05/28 16:37:35 You mean incorrectly?
hongchan 2015/06/09 20:49:58 Oops. Will fix it.
+ }.bind(this));
+ };
+
+ // Check if the target promise is rejected correctly.
+ //
+ // Example:
+ // Should('My promise', promise).beRejected().then(nextStuff);
+ // Result:
+ // "PASS My promise rejected correctly."
+ ShouldModel.prototype.beRejected = function () {
+ return this.target.then(function () {
+ this._testFailed('resolved correctly.');
hongchan 2015/06/09 20:49:58 Will fix this too.
+ }.bind(this), function (err) {
+ this._testPassed('rejected correctly. (with ' + err + ')');
+ }.bind(this));
+ };
+
// Should() method.
//
// |desc| is the description of the task or check and |target| is a value
@@ -652,5 +680,4 @@ var Should = (function () {
return new ShouldModel(desc, target, _opts);
};
-
-})();
+})();

Powered by Google App Engine
This is Rietveld 408576698