| <html> |
| <body onload="runTest()"> |
| <div contenteditable>drag<img src=abe.png id=dragme>me<span id=target> </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> |