Index: LayoutTests/webaudio/resources/audio-testing.js |
diff --git a/LayoutTests/webaudio/resources/audio-testing.js b/LayoutTests/webaudio/resources/audio-testing.js |
index 9cc82ce733e32aa04658acccd63ff3faf81b2960..ce9ceb68e8019ee979edbb0a31fb0370716b45d2 100644 |
--- a/LayoutTests/webaudio/resources/audio-testing.js |
+++ b/LayoutTests/webaudio/resources/audio-testing.js |
@@ -440,6 +440,24 @@ 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" |
+ // "FAIL SNR (n) is not greater than or equal to 100" |
+ 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. |
// |