Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: LayoutTests/fast/events/before-unload-return-bad-value.html

Issue 23600034: Use TRYCATCH_FOR_V8STRINGRESOURCE in AbstractEventListener::invokeEventHandler() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/before-unload-return-bad-value-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..dc59262271d7d697c1d35e8596fd4f5d81494e26
--- /dev/null
+++ b/LayoutTests/fast/events/before-unload-return-bad-value.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+<script>
+if (window.testRunner)
+ testRunner.setShouldStayOnPageAfterHandlingBeforeUnload(true);
+
+window.onload = function() {
+ window.location.href = "resources/does-not-exist.html";
+ setTimeout(finishJSTest, 0);
arv (Not doing code reviews) 2013/09/11 13:42:19 Why is this needed? window.onerror calls finishJST
do-not-use 2013/09/11 14:12:29 I had it in case it did not throw, to avoid a time
+}
arv (Not doing code reviews) 2013/09/11 13:42:19 semicolons after assignment.
+
+var nonConvertibleToString = {toString: function() { throw "Exception in toString()"; }};
+
+var testMessage;
+window.onerror = function(msg) {
+ testMessage = msg;
+ shouldBeEqualToString("testMessage", "Uncaught Exception in toString()");
+ setTimeout(finishJSTest, 0);
do-not-use 2013/09/11 09:00:43 I am not quite sure why this setTimeout() is neede
haraken 2013/09/11 09:08:44 Looks strange. arv, do you have any idea?
arv (Not doing code reviews) 2013/09/11 13:42:19 I'm not sure. Maybe it is related to setShouldStay
+ return true;
+}
+
+window.onbeforeunload = function(event) {
+ return nonConvertibleToString;
+}
+</script>
+</head>
+<body>
+<script>
+description("Tests that an exception is thrown when the value returned in the beforeunload callback cannot be converted to a String");
+window.jsTestIsAsync = true;
arv (Not doing code reviews) 2013/09/11 13:42:19 move this to other script block, before if window.
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
+
« no previous file with comments | « no previous file | LayoutTests/fast/events/before-unload-return-bad-value-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698