<!DOCTYPE html>
<html>
<head>
<script>
    if (window.testRunner) {
        testRunner.waitUntilDone();
        testRunner.dumpAsText();
    }

    var workToDo;

    function registerAction(action)
    {
        workToDo = action;
    }

    function run()
    {
        if (!window.eventSender)
            return;

        var anchor = document.getElementById("start");
        var x = window.frameElement.offsetLeft + anchor.offsetLeft + 2;
        var y = window.frameElement.offsetTop + anchor.offsetTop + 2;
        eventSender.mouseMoveTo(x, y);
        eventSender.mouseDown();
        eventSender.mouseUp();
        workToDo();
    }
</script>
</head>
<body>
    <a id="start" href="#anchor">Go to anchor</a>
    <div id="might_scroll" style="height: 1000px"></div>
    <a name="anchor">Anchor</a>
</body>
</html>