<!-- This page accepts a query string specifying how many history items should
be present once it finishes loading. -->

<html>
<head>
<title>Redirect Target</title>

<script>
function log(s)
{
    document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
}

function testHistoryItemCount()
{
    var expected = parseInt(location.hash.slice(1));
    var actual = history.length;
    if (actual === expected)
        log("PASS: History item count should be " + expected + " and is.");
    else
        log("FAIL: History item count should be " + expected + " but instead is " + actual + ".");
}

window.addEventListener("load", function () {
    if (window.testRunner) {
        testRunner.dumpAsText();
        testHistoryItemCount();
        testRunner.dumpBackForwardList();
        testRunner.notifyDone();
    } else {
        testHistoryItemCount();
    }
}, false);
</script>
</head>

<body>
<p>This page is the target of a redirect.</p>
<pre id="console"></pre>
</body>
</html>
