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

function done()
{
    if (document.getElementById("results").innerHTML == "")
        document.getElementById("results").appendChild(document.createTextNode("PASS"));
    if (testRunner)
        testRunner.notifyDone();
}

function removeFrame()
{
    var foo = document.getElementById('foo');
    foo.parentNode.removeChild(foo);
    done();
}
</script>
<body>
<p>
    This is a test for <a href="https://bugs.webkit.org/show_bug.cgi?id=34226">bug 34226</a>:
    <i>[v8]: Regression: onunload event handling</i>. If successful, PASS should be printed below.
</p>
<p id="results" class="pass"></p>
<iframe id='foo' src="data:text/html,<body onunload='handleUnload()'><script>function handleUnload() {var now=new Date();var exitTime=now.getTime()+5000;while(true){now=new Date();if(now.getTime()>exitTime)break}}</script></body>" onload="removeFrame()"></iframe>
</body>
</html>