summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/js/resources/js-test-pre.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/js/resources/js-test-pre.js')
-rw-r--r--LayoutTests/fast/js/resources/js-test-pre.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/LayoutTests/fast/js/resources/js-test-pre.js b/LayoutTests/fast/js/resources/js-test-pre.js
index 6647798..93c3cb6 100644
--- a/LayoutTests/fast/js/resources/js-test-pre.js
+++ b/LayoutTests/fast/js/resources/js-test-pre.js
@@ -1,5 +1,6 @@
+// svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump text + pixel results
if (window.layoutTestController)
- layoutTestController.dumpAsText();
+ layoutTestController.dumpAsText(window.enablePixelTesting);
function description(msg)
{
@@ -218,6 +219,26 @@ function shouldBeUndefined(_a)
testFailed(_a + " should be undefined. Was " + _av);
}
+function shouldBeGreaterThanOrEqual(_a, _b) {
+ if (typeof _a != "string" || typeof _b != "string")
+ debug("WARN: shouldBeGreaterThanOrEqual 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 shouldThrow(_a, _e)
{