<html>

<head>
<script>

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function unload()
{
    alert("unload");
}

function load()
{
    window.onunload = unload;
    location = "data:text/html,You should have seen an unload alert appear.<script>if (window.testRunner) testRunner.notifyDone(); </" + "script>";
}

</script>
</head>

<body onload="load()">
start document
</body>

</html>
