<script>
    if (window.layoutTestController) {
        layoutTestController.dumpAsText();
        layoutTestController.setCanOpenWindows();
        layoutTestController.setCloseRemainingWindowsWhenComplete();
        layoutTestController.waitUntilDone();
    }

    var win = window.open("resources/dom-access-from-closure-window-child.html", "child");

    function log(s)
    {
        document.getElementById('console').appendChild(document.createTextNode(s + "\n"));
    }

    function done()
    {
        // Call the method injected by resources/dom-access-from-closure-window-child.html
        accessFrame();

        if (window.layoutTestController)
            layoutTestController.notifyDone();
    }
</script>
<pre id="console"></pre>
