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

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: Bring ToT Created 5 years, 5 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 ce9ceb68e8019ee979edbb0a31fb0370716b45d2..582f6dbc770eb553e822227e2b5eb34e99a9a1dc 100644
--- a/LayoutTests/webaudio/resources/audio-testing.js
+++ b/LayoutTests/webaudio/resources/audio-testing.js
@@ -660,6 +660,36 @@ 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."
+ // "FAIL My promise rejected incorrectly (with _ERROR_)."
+ ShouldModel.prototype.beResolved = function () {
+ return this.target.then(function () {
+ this._testPassed('resolved correctly');
+ }.bind(this), function (err) {
+ this._testFailed('rejected incorrectly (with ' + err + ')');
+ }.bind(this));
+ };
+
+ // Check if the target promise is rejected correctly.
+ //
+ // Example:
+ // Should('My promise', promise).beRejected().then(nextStuff);
+ // Result:
+ // "PASS My promise rejected correctly (with _ERROR_)."
+ // "FAIL My promise resolved incorrectly."
+ ShouldModel.prototype.beRejected = function () {
+ return this.target.then(function () {
+ this._testFailed('resolved incorrectly');
+ }.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
@@ -681,5 +711,4 @@ var Should = (function () {
return new ShouldModel(desc, target, _opts);
};
-
-})();
+})();

Powered by Google App Engine
This is Rietveld 408576698