Index: LayoutTests/resources/js-test.js |
diff --git a/LayoutTests/resources/js-test.js b/LayoutTests/resources/js-test.js |
index 985f49f60213af05b1b00cecc02f42134f2cdeb7..d244de99fcb45b987c0c3177c85b102a984c54eb 100644 |
--- a/LayoutTests/resources/js-test.js |
+++ b/LayoutTests/resources/js-test.js |
@@ -532,6 +532,27 @@ function shouldBeDefined(_a) |
testFailed(_a + " should be defined. Was " + _av); |
} |
+function shouldBeGreaterThan(_a, _b) { |
+ if (typeof _a != "string" || typeof _b != "string") |
+ debug("WARN: shouldBeGreaterThan expects string arguments"); |
+ |
+ var _exception; |
+ var _av; |
+ try { |
+ _av = eval(_a); |
+ } catch (e) { |
+ _exception = e; |
+ } |
+ var _bv = eval(_b); |
+ |
+ if (_exception) |
+ testFailed(_a + " should be > " + _b + ". Threw exception " + _exception); |
+ else if (typeof _av == "undefined" || _av <= _bv) |
+ testFailed(_a + " should be > " + _b + ". Was " + _av + " (of type " + typeof _av + ")."); |
+ else |
+ testPassed(_a + " is > " + _b); |
+} |
+ |
function shouldBeGreaterThanOrEqual(_a, _b) { |
if (typeof _a != "string" || typeof _b != "string") |
debug("WARN: shouldBeGreaterThanOrEqual expects string arguments"); |