blob: 909a13ea0d91e8b3bf3e9822a4677a106af540ba [file] [log] [blame]
bdakin@apple.com4f4847f2015-09-04 23:48:58 +00001<html>
2<head>
3<script>
4
5var didNavigate = false;
6
7window.onbeforeunload = function () {
8 didNavigate = true;
9};
10
11function checkForDone()
12{
13 if (!didNavigate) {
14 var console = document.getElementById("console");
15 console.innerHTML = "SUCCESS! We did not navigate to the link after starting a force click.";
16 }
17
18 if (window.testRunner)
19 testRunner.notifyDone();
20}
21
22function spinRunLoop()
23{
24 window.setTimeout(checkForDone, 0);
25}
26
27function startTest()
28{
29 if (window.testRunner) {
30 testRunner.dumpAsText();
31 testRunner.waitUntilDone();
32 }
33
34 if (window.eventSender) {
35 eventSender.mouseMoveTo(16, 16);
36 eventSender.startAndCancelMouseForceClick();
37 window.setTimeout(spinRunLoop, 0);
38 }
39}
40</script>
41</head>
42
43<body onload="startTest()">
44
45<a href="resources/do-not-navigate-here.html">Link</a>
46<pre id="console">Failed. This test must be run in the test harness. To run the test manually, start force clicking on the link, but don't click hard enough to pop open the preview. Then make sure that the original document does not navigate anywhere.</pre>
47
48</body>
49</html>