blob: 17b18c37be75f03627511af7e212dffd7ddb16e5 [file] [log] [blame]
<body onload="test()">
<input type="search" id="target" placeholder="Placeholder text" onfocus="window.hasFocus=1">
<pre id="console"></pre>
<script>
var hasFocus = 0;
function log(message) {
document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
}
function test() {
if (!window.eventSender)
return;
testRunner.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(hasFocus ? "PASS" : "FAIL");
}
</script>
</body>