Chromium Code Reviews| 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 09f2bf7081920d1f4bb9b6ebfb742a810dd2233c..88fdb2530cd7adad3f940da9466f2c4d58dcbbf8 100644 |
| --- a/third_party/WebKit/LayoutTests/webaudio/resources/audio-testing.js |
| +++ b/third_party/WebKit/LayoutTests/webaudio/resources/audio-testing.js |
| @@ -1138,6 +1138,32 @@ var Should = (function () { |
| }.bind(this)); |
| }; |
| + // Check if the target is null |
| + // |
| + // Example: |
| + // Should("Value", value).beNull(); |
| + // Result: |
| + // "PASS Value is null." |
| + // "FAIL value is not null." |
| + ShouldModel.prototype.beNull = function () { |
|
Raymond Toy
2016/08/08 21:24:37
Maybe we don't want this and have the user use beE
|
| + if (this.target === null) |
| + this._testPassed("is null"); |
| + else |
| + this._testFailed("is not null"); |
| + |
| + return this._success; |
| + } |
| + |
| + // The opposite of beNull(). |
| + ShouldModel.prototype.notBeNull = function () { |
| + if (this.target === null) |
| + this._testFailed("is null"); |
| + else |
| + this._testPassed("is not null"); |
| + |
| + return this._success; |
| + } |
| + |
| // Should() method. |
| // |
| // |desc| is the description of the task or check and |target| is a value |