Chromium Code Reviews| 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> |
| + <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() { |
| + window.setTimeout(clickLink, 100); |
|
clamy
2016/03/22 16:33:46
The browser will hang in BeforeUnload, so I can't
|
| + return true; |
| +} |
| + |
| + window.addEventListener("beforeunload", function(e){ |
| + var confirmationMessage = "foo"; |
| + e.returnValue = confirmationMessage; |
| + return confirmationMessage; |
| + }); |
| + |
| + </script> |
| + </head> |
| + |
| + <a href="title2.html" id="link">link</a><br> |
| + |
| + </html> |