Index: LayoutTests/fast/events/before-unload-return-bad-value.html |
diff --git a/LayoutTests/fast/events/before-unload-return-bad-value.html b/LayoutTests/fast/events/before-unload-return-bad-value.html |
index 4a7d6d5c25aaba530155c60d2cee897f10a2e73c..5fad9b9da43cea540c9c45ab793d58f3886978a6 100644 |
--- a/LayoutTests/fast/events/before-unload-return-bad-value.html |
+++ b/LayoutTests/fast/events/before-unload-return-bad-value.html |
@@ -6,7 +6,12 @@ |
description("Tests that an exception is thrown when the value returned in the beforeunload callback cannot be converted to a String"); |
window.jsTestIsAsync = true; |
+var alreadyTested = false; |
function test(frame) { |
+ if (alreadyTested) |
+ return; |
+ alreadyTested = true; |
+ |
frame.contentWindow.onbeforeunload = function(event) { |
return {toString: function() { throw "Exception in toString()"; }}; |
}; |
@@ -20,7 +25,6 @@ window.onerror = function(msg) { |
testMessage = msg; |
testPassed("Exception was thrown"); |
shouldBeEqualToString("testMessage", "Uncaught Exception in toString()"); |
- setTimeout(finishJSTest, 0); |
return true; |
}; |
</script> |