| <body onload="test()"> |
| <input type="search" id="target" placeholder="Placeholder text"> |
| <pre id="console"></pre> |
| <script> |
| function log(message) { |
| document.getElementById("console").appendChild(document.createTextNode(message + "\n")); |
| } |
| |
| function test() { |
| if (!window.layoutTestController) |
| return; |
| |
| layoutTestController.dumpAsText(); |
| |
| var target = document.getElementById("target"); |
| var x = target.offsetParent.offsetLeft + target.offsetLeft + target.offsetWidth / 2; |
| var y = target.offsetParent.offsetTop + target.offsetTop + target.offsetHeight / 2; |
| |
| eventSender.mouseMoveTo(x, y); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); |
| log(getSelection().baseNode == null ? "FAIL" : "PASS"); |
| } |
| </script> |
| </body> |