diff options
Diffstat (limited to 'LayoutTests/fast/js/resources')
4 files changed, 30 insertions, 7 deletions
diff --git a/LayoutTests/fast/js/resources/getOwnPropertyDescriptor.js b/LayoutTests/fast/js/resources/getOwnPropertyDescriptor.js index 880aed4..eb01411 100644 --- a/LayoutTests/fast/js/resources/getOwnPropertyDescriptor.js +++ b/LayoutTests/fast/js/resources/getOwnPropertyDescriptor.js @@ -39,6 +39,9 @@ descriptorShouldBe("Math.sin", "'length'", {writable: false, enumerable: false, descriptorShouldBe("Math.sin", "'name'", {writable: false, enumerable: false, configurable: false, value:"'sin'"}); var global = this; descriptorShouldBe("global", "'global'", {writable: true, enumerable: true, configurable: false, value:"global"}); +descriptorShouldBe("global", "'undefined'", {writable: false, enumerable: false, configurable: false, value:"undefined"}); +descriptorShouldBe("global", "'NaN'", {writable: false, enumerable: false, configurable: false, value:"NaN"}); +descriptorShouldBe("global", "'Infinity'", {writable: false, enumerable: false, configurable: false, value:"Infinity"}); descriptorShouldBe("global", "'window'", {writable: false, enumerable: true, configurable: false, value:"global"}); descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: true, configurable: false, value:"XMLHttpRequest"}); descriptorShouldBe("global", "'length'", {writable: true, enumerable: true, configurable: false, value:"global.length"}); diff --git a/LayoutTests/fast/js/resources/js-test-post-async.js b/LayoutTests/fast/js/resources/js-test-post-async.js new file mode 100644 index 0000000..76777aa --- /dev/null +++ b/LayoutTests/fast/js/resources/js-test-post-async.js @@ -0,0 +1,5 @@ +shouldBeTrue("successfullyParsed"); +debug('<br /><span class="pass">TEST COMPLETE</span>'); + +if (window.layoutTestController) + layoutTestController.notifyDone(); diff --git a/LayoutTests/fast/js/resources/js-test-post.js b/LayoutTests/fast/js/resources/js-test-post.js index 6d8a68f..88882c5 100644 --- a/LayoutTests/fast/js/resources/js-test-post.js +++ b/LayoutTests/fast/js/resources/js-test-post.js @@ -1,2 +1,13 @@ -shouldBeTrue("successfullyParsed"); -debug('<br /><span class="pass">TEST COMPLETE</span>'); +function finishJSTest() +{ + shouldBeTrue("successfullyParsed"); + debug('<br /><span class="pass">TEST COMPLETE</span>'); + if (window.jsTestIsAsync && window.layoutTestController) + layoutTestController.notifyDone(); +} + +if (window.jsTestIsAsync) { + if (window.layoutTestController) + layoutTestController.waitUntilDone(); +} else + finishJSTest(); diff --git a/LayoutTests/fast/js/resources/js-test-pre.js b/LayoutTests/fast/js/resources/js-test-pre.js index b91812f..ecf5fd0 100644 --- a/LayoutTests/fast/js/resources/js-test-pre.js +++ b/LayoutTests/fast/js/resources/js-test-pre.js @@ -37,11 +37,15 @@ function testFailed(msg) function areArraysEqual(_a, _b) { - if (_a.length !== _b.length) - return false; - for (var i = 0; i < _a.length; i++) - if (_a[i] !== _b[i]) + try { + if (_a.length !== _b.length) return false; + for (var i = 0; i < _a.length; i++) + if (_a[i] !== _b[i]) + return false; + } catch (ex) { + return false; + } return true; } @@ -118,7 +122,7 @@ function shouldBeNull(_a) { shouldBe(_a, "null"); } function shouldBeEqualToString(a, b) { - var unevaledString = '"' + b.replace(/"/g, "\"") + '"'; + var unevaledString = '"' + b.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"'; shouldBe(a, unevaledString); } |