<!DOCTYPE html>
<style>
#image {
width: 22px;
height: 22px;
image-rendering: pixelated;
}
</style>
<body>
<!-- Simulate dragging an image and dump the generated drag image. -->
<img id="image" src="resources/grid-small.png">
</body>
<script>
function drag() {
testRunner.dumpDragImage();
var image = document.getElementById('image');
var startX = image.offsetLeft + image.offsetWidth / 2;
var startY = image.offsetTop + image.offsetHeight / 2;
var positionX = startX + image.offsetWidth;
var positionY = startY + image.offsetHeight;
eventSender.dragMode = true;
eventSender.mouseMoveTo(startX, startY);
eventSender.mouseDown();
eventSender.mouseMoveTo(positionX, positionY);
eventSender.mouseUp();
}
if (!window.testRunner || !window.eventSender) {
document.write("This test does not work in manual mode.");
} else {
window.onload = drag;
}
</script>