| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../js/resources/js-test-pre.js"></script> | 3 <script src="../js/resources/js-test-pre.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 window.jsTestIsAsync = true; |
| 6 if (window.testRunner) | 6 if (window.testRunner) |
| 7 testRunner.waitUntilDone() | 7 testRunner.waitUntilDone() |
| 8 | 8 |
| 9 var LeftMouseButton = 0; | 9 var LeftMouseButton = 0; |
| 10 var MiddleMouseButton = 1; | 10 var MiddleMouseButton = 1; |
| 11 | 11 |
| 12 var testContainer; | 12 var testContainer; |
| 13 var didClickLink1 = false; | 13 var didClickLink1 = false; |
| 14 | 14 |
| 15 window.onload = function() | 15 window.onload = function() |
| (...skipping 20 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 eventSender.mouseMoveTo(testContainer.offsetLeft + 10, testContainer.offsetT
op + 10); | 37 eventSender.mouseMoveTo(testContainer.offsetLeft + 10, testContainer.offsetT
op + 10); |
| 38 eventSender.mouseDown(MiddleMouseButton); | 38 eventSender.mouseDown(MiddleMouseButton); |
| 39 eventSender.mouseUp(MiddleMouseButton); | 39 eventSender.mouseUp(MiddleMouseButton); |
| 40 eventSender.mouseMoveTo(testContainer.offsetLeft + 10, testContainer.offsetT
op + testContainer.offsetHeight); | 40 eventSender.mouseMoveTo(testContainer.offsetLeft + 10, testContainer.offsetT
op + testContainer.offsetHeight); |
| 41 setTimeout(clickHyperlinksIfScrolledToBottomOtherwiseFail, 500); // 500ms sh
ould be reasonable to scroll to the bottom of the <div>. | 41 setTimeout(clickHyperlinksIfScrolledToBottomOtherwiseFail, 500); // 500ms sh
ould be reasonable to scroll to the bottom of the <div>. |
| 42 } | 42 } |
| 43 | 43 |
| 44 function finished() | 44 function finished() |
| 45 { | 45 { |
| 46 debug('<br /><span class="pass">TEST COMPLETE</span>'); | |
| 47 document.body.removeChild(document.getElementById("test-container")); | 46 document.body.removeChild(document.getElementById("test-container")); |
| 48 if (window.testRunner) | 47 finishJSTest(); |
| 49 testRunner.notifyDone(); | |
| 50 } | 48 } |
| 51 | 49 |
| 52 function clickHyperlinksIfScrolledToBottomOtherwiseFail() | 50 function clickHyperlinksIfScrolledToBottomOtherwiseFail() |
| 53 { | 51 { |
| 54 var didScrollToBottom = testContainer.scrollTop === testContainer.scrollHeig
ht - testContainer.clientHeight; | 52 var didScrollToBottom = testContainer.scrollTop === testContainer.scrollHeig
ht - testContainer.clientHeight; |
| 55 if (!didScrollToBottom) { | 53 if (!didScrollToBottom) { |
| 56 testFailed("either pan scrolling is disabled or this platform doesn't su
pport pan scrolling."); | 54 testFailed("either pan scrolling is disabled or this platform doesn't su
pport pan scrolling."); |
| 57 finished(); | 55 finished(); |
| 58 return; | 56 return; |
| 59 } | 57 } |
| 60 | 58 |
| 61 if (!window.eventSender) | 59 if (!window.eventSender) |
| 62 return; | 60 return; |
| 63 | 61 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 85 <div id="dummy" style="height:200px"><!-- dummy element to overflow test-con
tainer --></div> | 83 <div id="dummy" style="height:200px"><!-- dummy element to overflow test-con
tainer --></div> |
| 86 <a id="firstLink" href="#" onclick="didClickLink1=true">Link 1</a> <a id="se
condLink" href="#" onclick="checkIfClickedLink1AndFinish()">Link 2</a> | 84 <a id="firstLink" href="#" onclick="didClickLink1=true">Link 1</a> <a id="se
condLink" href="#" onclick="checkIfClickedLink1AndFinish()">Link 2</a> |
| 87 </div> | 85 </div> |
| 88 <div id="console"></div> | 86 <div id="console"></div> |
| 89 <script> | 87 <script> |
| 90 description("This test can be used to verify that clicking on a hyperlink is
ignored when in pan scroll mode. <br/>" + | 88 description("This test can be used to verify that clicking on a hyperlink is
ignored when in pan scroll mode. <br/>" + |
| 91 "Note, this test is expected to fail on the Apple Mac and Chromi
um Mac port since they don't support pan scrolling."); | 89 "Note, this test is expected to fail on the Apple Mac and Chromi
um Mac port since they don't support pan scrolling."); |
| 92 </script> | 90 </script> |
| 93 </body> | 91 </body> |
| 94 </html> | 92 </html> |
| OLD | NEW |