<html>
<head>
<script>
function endTest() {
    window.opener.log("PASS.");
    window.opener.finish();
}

function loadNext() {
    if (window.opener.canExit2) {
        endTest();
        return;
    }

    window.opener.log("page-1, about to navigate to page-2.")
    // Location changes need to happen outside the onload handler to generate history entries.
    setTimeout(function() {location.href = "cached-page-2.html";}, 0);
}

</script>
</head>
<body onpageshow="loadNext()">
</body>
</html>
