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..3cd09aeda4c6e980d97d49cc844b2d2fdb141e9e 100644 |
--- a/LayoutTests/webaudio/resources/audio-testing.js |
+++ b/LayoutTests/webaudio/resources/audio-testing.js |
@@ -429,6 +429,23 @@ var Should = (function () { |
this._testPassed('is not equal to ' + value); |
}; |
+ // Check if |target| is greater than or equal to |value|. |
+ // |
+ // Example: |
+ // Should("SNR", snr).greaterThanOrEqualTo(100); |
+ // Result: |
+ // "PASS SNR exceeds 100" |
hongchan
2015/07/22 21:01:19
We previously agreed to add the example message fr
Raymond Toy
2015/07/23 15:33:09
Done.
|
+ ShouldModel.prototype.beGreaterThanOrEqualTo = function (value) { |
+ var type = typeof value; |
+ this._assert(type === 'number' || type === 'string', |
+ 'value should be number or string for'); |
+ |
+ if (this.target >= value) |
+ this._testPassed("is greater than or equal to " + value); |
+ else |
+ this._testFailed("(" + this.target + ") is not greater than or equal to " + value); |
+ } |
+ |
// Check if |func| throws an exception with a certain |errorType| correctly. |
// |errorType| is optional. |
// |