| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 <div id="touchtarget" style="width: 100px; height: 100px; background-color: blue
"></div> | 5 <div id="touchtarget" style="width: 100px; height: 100px; background-color: blue
"></div> |
| 6 <p id="description"></p> | 6 <p id="description"></p> |
| 7 <div id="console"></div> | 7 <div id="console"></div> |
| 8 <script> | 8 <script> |
| 9 var div = document.getElementById("touchtarget"); | 9 var div = document.getElementById("touchtarget"); |
| 10 var lastEvent = null; | 10 var lastEvent = null; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 { | 87 { |
| 88 eventSender.mouseMoveTo(10, 10); | 88 eventSender.mouseMoveTo(10, 10); |
| 89 eventSender.mouseDown(0, ["shiftKey", "altKey"]); | 89 eventSender.mouseDown(0, ["shiftKey", "altKey"]); |
| 90 eventSender.mouseMoveTo(20, 30); | 90 eventSender.mouseMoveTo(20, 30); |
| 91 eventSender.mouseUp(0, ["altKey", "ctrlKey"]); | 91 eventSender.mouseUp(0, ["altKey", "ctrlKey"]); |
| 92 } | 92 } |
| 93 | 93 |
| 94 if (window.eventSender && window.internals && window.internals.settings) { | 94 if (window.eventSender && window.internals && window.internals.settings) { |
| 95 description("This tests single touch event emulation using mouse events."); | 95 description("This tests single touch event emulation using mouse events."); |
| 96 | 96 |
| 97 // Mouse events only work after an initial layout |
| 98 document.body.offsetLeft; |
| 99 |
| 97 window.eventSender.dragMode = false; | 100 window.eventSender.dragMode = false; |
| 98 window.jsTestIsAsync = true; | 101 window.jsTestIsAsync = true; |
| 99 window.internals.settings.setTouchEventEmulationEnabled(true); | 102 window.internals.settings.setTouchEventEmulationEnabled(true); |
| 100 | 103 |
| 101 shouldBe("'ontouchstart' in window", "true"); | 104 shouldBe("'ontouchstart' in window", "true"); |
| 102 shouldBe("'ontouchend' in document", "true"); | 105 shouldBe("'ontouchend' in document", "true"); |
| 103 | 106 |
| 104 mouseEventSequence(); | 107 mouseEventSequence(); |
| 105 } else | 108 } else |
| 106 debug("This test requires DumpRenderTree. Tap on the blue rect to log."); | 109 debug("This test requires DumpRenderTree. Tap on the blue rect to log."); |
| 107 </script> | 110 </script> |
| 108 <script src="../../js/resources/js-test-post.js"></script> | 111 <script src="../../js/resources/js-test-post.js"></script> |
| 109 </body> | 112 </body> |
| 110 </html> | 113 </html> |
| OLD | NEW |