| <html> |
| <head> |
| <script> |
| |
| var didNavigate = false; |
| |
| window.onbeforeunload = function () { |
| didNavigate = true; |
| }; |
| |
| function checkForDone() |
| { |
| if (!didNavigate) { |
| var console = document.getElementById("console"); |
| console.innerHTML = "SUCCESS! We did not navigate to the link after force clicking it."; |
| } |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| |
| function spinRunLoop() |
| { |
| window.setTimeout(checkForDone, 0); |
| } |
| |
| function startTest() |
| { |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| if (window.eventSender) { |
| eventSender.mouseMoveTo(16, 16); |
| eventSender.mouseForceClick(); |
| window.setTimeout(spinRunLoop, 0); |
| } |
| } |
| </script> |
| </head> |
| |
| <body onload="startTest()"> |
| |
| <a href="resources/do-not-navigate-here.html">Link</a> |
| <pre id="console">Failed. This test must be run in the test harness. To run the test manually, force click on the link and make sure that the original document does not navigate anywhere.</pre> |
| |
| </body> |
| </html> |