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

Unified Diff: LayoutTests/fast/loader/form-submission-after-beforeunload-cancel.html

Issue 158783002: Limit beforeunload returnValue propagation to event handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch tests to use onbeforeunload event handlers instead. Created 6 years, 10 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
Index: LayoutTests/fast/loader/form-submission-after-beforeunload-cancel.html
diff --git a/LayoutTests/fast/loader/form-submission-after-beforeunload-cancel.html b/LayoutTests/fast/loader/form-submission-after-beforeunload-cancel.html
index 48d56e10922c3a6d7ce3daf2638c6225ecb7aedb..692583f6325afef36481d49fab8e4417e4e7ef3a 100644
--- a/LayoutTests/fast/loader/form-submission-after-beforeunload-cancel.html
+++ b/LayoutTests/fast/loader/form-submission-after-beforeunload-cancel.html
@@ -7,7 +7,7 @@ if (window.testRunner) {
_confirmationDialogDisplayedOnce = false;
-window.addEventListener("beforeunload", function() {
+window.onbeforeunload = function() {
if (window._confirmationDialogDisplayedOnce)
return "Click 'Leave Page'";
@@ -24,11 +24,11 @@ window.addEventListener("beforeunload", function() {
document.forms[0].submit();
}, 0);
-
+
window._confirmationDialogDisplayedOnce = true;
-
+
return "Click 'Stay on Page'";
-});
+};
</script>
<p>This tests that submitting a form a second time after canceling the first submission in a onbeforeunload handler is allowed. To test manually, follow the instructions in the JavaScript confirmation dialogs.</p>
@@ -40,4 +40,4 @@ window.addEventListener("beforeunload", function() {
<script>
document.forms[0].submit();
-</script>
+</script>

Powered by Google App Engine
This is Rietveld 408576698