<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>

<script>
description('Tests that loading is not stopped by going forward to a fragment.');

onload = function()
{
    if (window.localStorage.stage == 'three') {
        console.log('3. Got back to start.  Going forward to page 2.');
        window.localStorage.stage = 'four';
        history.forward();
    } else if (window.localStorage.stage == 'six') {
        delete window.localStorage.stage;
        finishJSTest();
    } else {
        // To make sure that we hit this branch, log this to the console so that
        // it shows up in expected output (debug() will be blown away once we
        // navigate out).
        console.log('Starting test.');
        window.localStorage.stage = 'one';
        // Navigate in a timeout to make sure we create a history entry.
        setTimeout(function() {
            window.location.href = 'resources/forward-to-fragment-fires-onload-2.html';
        }, 0);
    }
};

var jsTestIsAsync = true;
</script>

<script src="../../../resources/js-test-post.js"></script>
</body>
</html>
