blob: 2025353138c071a158471d494a130a6a54b588f9 [file] [log] [blame]
<html>
<head>
<link rel="stylesheet" href="../js/resources/js-test-style.css">
<script src="../js/resources/js-test-pre.js"></script>
<script>
var successfullyParsed = false;
function resetField()
{
event.target.value = '';
}
function runTest()
{
if (window.layoutTestController) {
layoutTestController.dumpAsText();
elementToDrag = document.getElementById("elementToDrag");
x1 = elementToDrag.offsetLeft + elementToDrag.offsetWidth / 2;
y1 = elementToDrag.offsetTop + elementToDrag.offsetHeight / 2;
dragTarget = document.getElementById("dragTarget");
x2 = dragTarget.offsetLeft + dragTarget.offsetWidth / 2;
y2 = dragTarget.offsetTop + dragTarget.offsetHeight / 2;
eventSender.mouseMoveTo(x1,y1);
eventSender.mouseDown();
eventSender.leapForward(400);
eventSender.mouseMoveTo(x2, y2);
eventSender.mouseUp();
shouldBe("dragTarget.value", "elementToDrag.href");
testPassed("Didn't crash.");
//clean up output
elementToDrag.parentNode.removeChild(elementToDrag);
dragTarget.parentNode.removeChild(dragTarget);
} else {
debug('<br>To test this manually drag the link into the text field.')
}
}
</script>
</head>
<body>
<p id="description"></p>
<a id="elementToDrag" href="http://example.com">A link!</a>
<input id="dragTarget" type="text" value="Original Text" onfocus="resetField()" />
<div id="console"></div>
<script>
description("This tests that we don't lose data dropped onto an input field that changes its content during a drop event");
runTest();
successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>