2010-07-30 Patrick Gansterer <paroga@paroga.com>
[WebKit-https.git] / LayoutTests / fast / history / gesture-before-onload.html
1 <head>
2 </head>
3 <body onload="onload()">
4   <button id="nav-button" onclick="nav();">Navigate</button>
5   <div id="manual-explanation" style="display: none; color: blue">When running this test outside of DRT, please click on the "Navigate" button.</div>
6 </body>
7 <script>
8   if (window.layoutTestController) {
9       layoutTestController.clearBackForwardList();
10       layoutTestController.waitUntilDone();
11   }
12
13   if (window.eventSender) {
14       var navButtonNode = document.getElementById('nav-button');
15       eventSender.mouseMoveTo(
16           navButtonNode.offsetLeft + navButtonNode.offsetWidth / 2,
17           navButtonNode.offsetTop + navButtonNode.offsetHeight / 2);
18       eventSender.mouseDown();
19       eventSender.mouseUp();
20   } else {
21       document.getElementById('manual-explanation').style.display = '';
22   }
23
24   function nav() {
25       window.location.href = 'resources/gesture-before-onload-target.html#2';
26   }
27
28   function onload() {
29       window.console.log('FAIL: Should not have reached onload before navigating away');
30   }
31 </script>
32