<html>
<head>
<style type="text/css">
.bookmark {
    background-image:url(resources/bookmark.gif);
    text-indent:-1000px;
    display:block;
    height:25px;
    width:80px;
}
</style>
</head>
<script>
var dragStarted = false;
window.ondragstart = function() {
    dragStarted = true;
}

window.ondragend = function() {
    if (!window.testRunner)
        return;

    if (dragStarted) {
        document.getElementById('results').innerHTML = 'Test passed.';
    }
}

function test() {
    if (!window.testRunner)
        return;

    if (!window.eventSender)
        return;

    document.getElementById('results').innerHTML = 'Test failed.';

    testRunner.dumpAsText();
    testRunner.waitUntilDone();

    var testBookmark = document.getElementById('testBookmark');
    var x = testBookmark.offsetLeft + testBookmark.offsetWidth / 2;
    var y = testBookmark.offsetTop + testBookmark.offsetHeight / 2;

    eventSender.mouseMoveTo(x, y);
    eventSender.mouseDown();
    eventSender.mouseMoveTo(x + 100, y + 100);
    eventSender.mouseUp();

    testRunner.notifyDone();
}
</script>

<body onload="test()">
<p>This tests a parent node (has child nodes) is draggable.
You should be able to drag the bookmark image below and drop it to bookmarks bar.
</p>
<a id="testBookmark" href="http://testbookmark" title="Bookmark" class="bookmark">Bookmark</a>
<br>
<div id="results"></div>
</body>
</html>
