| Index: third_party/WebKit/LayoutTests/webaudio/resources/audio-testing.js
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/audio-testing.js b/third_party/WebKit/LayoutTests/webaudio/resources/audio-testing.js
|
| index 25925627bef1130b41ca148e1f57213fe8f5f5df..a838881c5a688d4502fc8b06e90e07e4cc498399 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/resources/audio-testing.js
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/resources/audio-testing.js
|
| @@ -785,6 +785,36 @@ var Should = (function () {
|
| return this._success;
|
| };
|
|
|
| + // 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
|
|
|