Index: content/test/data/hang_before_unload.html |
diff --git a/content/test/data/hang_before_unload.html b/content/test/data/hang_before_unload.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8c7c1f014cf9043bfa8cefe8989f57aed053c126 |
--- /dev/null |
+++ b/content/test/data/hang_before_unload.html |
@@ -0,0 +1,30 @@ |
+<html> |
+ |
+<head><title>Possible BeforeUnload</title> |
Charlie Reis
2016/03/29 18:33:21
Why "Possible"?
clamy
2016/03/30 13:31:11
Because the first version did not have the dialog
|
+ <script> |
+ function clickLink() { |
+ var evt = document.createEvent("MouseEvents"); |
+ evt.initMouseEvent("click", true, true, window, |
+ 0, 0, 0, 0, 0, false, false, |
+ false, false, 0, null); |
+ var target = document.getElementById("link"); |
+ target.dispatchEvent(evt); |
+ } |
+ |
+function clickLinkSoon() { |
Charlie Reis
2016/03/29 18:33:21
nit: Use consistent indent.
clamy
2016/03/30 13:31:11
Done.
|
+ window.setTimeout(clickLink, 100); |
+ return true; |
+} |
+ |
+ window.addEventListener("beforeunload", function(e){ |
Charlie Reis
2016/03/29 18:33:21
nit: Space before {
clamy
2016/03/30 13:31:11
Done.
|
+ var confirmationMessage = "foo"; |
+ e.returnValue = confirmationMessage; |
+ return confirmationMessage; |
+ }); |
Charlie Reis
2016/03/29 18:33:21
nit: 2 fewer spaces.
clamy
2016/03/30 13:31:11
Done.
|
+ |
+ </script> |
+ </head> |
+ |
+ <a href="title2.html" id="link">link</a><br> |
+ |
+ </html> |