<!-- webkit-test-runner [ UsesBackForwardCache=true ] -->
<html><head>
<title>Image load in pagehide handler</title>
<script>

var testCalled = false;

function test() {
    if (!testCalled) {
        if (window.testRunner) {
            testRunner.dumpAsText();
            testRunner.waitUntilDone();
        }
        testCalled = true;
        return;
    }
    location.assign("resources/image-load-in-pagehide-handler-2.html");
}

function ping() {
    var img = new Image(1, 1);
    img.src = "resources/save-ping.py";
}

</script>
</head>
<body onload="test();" onpagehide="ping();">
<img src="resources/delete-ping.py" onload="test();" onerror="test();"></img>
<p>Tests that ping loads in 'pagehide' handlers go through.</p>
</body></html>
