blob: 28f5f86c2b3bc0c965ca519fcd15e0679d2aa115 [file] [log] [blame]
<html>
<head>
<script>
function log(message) {
var console = document.getElementById("console");
var li = document.createElement("li");
var text = document.createTextNode(message);
console.appendChild(li);
li.appendChild(text);
}
function runTest() {
if (!window.layoutTestController) {
log("To run this test manually attempt to drag and drop Abe after the broken image in the editable div");
return;
}
layoutTestController.waitUntilDone();
//find abe
var dragme = document.getElementById("dragme");
x1 = dragme.offsetLeft + 20;
y1 = dragme.offsetTop + 20;
// Find the target
var drag_target = document.getElementById("drag_target");
x2 = drag_target.offsetLeft + drag_target.offsetWidth / 2;
y2 = drag_target.offsetTop + drag_target.offsetHeight / 2;
// Drag abe into the editable
eventSender.mouseMoveTo(x1, y1);
eventSender.mouseDown();
eventSender.leapForward(500);
eventSender.mouseMoveTo(x2, y2);
eventSender.mouseUp();
layoutTestController.notifyDone();
}
</script>
<title>Dragging an image to the end of a content editable div in an iframe</title>
</head>
<body>
<p>This tests that we can drag an image into the last position of a content editable div in an iframe that already contains an image, without crashing.</p>
<img id="dragme" src="../resources/abe.png"/>
<iframe id="drag_target" onload="runTest();" src="resources/drag-image-to-contenteditable-iframe.html"></iframe>
<ul id="console"></ul>
</body>
</html>