blob: 8bfa7e828b4d2031914d77a6d8ffd0675e27770d [file] [log] [blame]
<html>
<body onload="runTest()">
<div contenteditable>drag<img src=abe.png id=dragme>me<span id=target>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<script>
function moveToCenter(element) {
var x, y;
x = element.offsetLeft + element.offsetWidth / 2;
y = element.offsetTop + element.offsetHeight / 2;
eventSender.mouseMoveTo(x, y);
}
function runTest() {
e = document.getElementById("dragme");
moveToCenter(e);
eventSender.mouseDown();
e = document.getElementById("target");
moveToCenter(e);
eventSender.mouseUp();
if (document.getElementById("dragme").parentNode.tagName == "SPAN" && document.getElementById("dragme").src.length > 10)
alert("PASS");
else
alert("FAIL");
testRunner.notifyDone();
}
</script>
</body>
</html>