<html>
<body onload="setTimeout(test, 100);">
This test does the following:<br>
1. Load a page, trigger an XHR.<br>
2. Reload the page.<br>
3. Dump the http readers for the reload of the XHR.<br><br>
The XHR is trigger after onload has fired. There should not be an HTTP_CACHE_CONTROL header forcing reload, so an http cache
could load the resource without contacting the server.<br>
The test passes if there is no HTTP_CACHE_CONTROL header displayed below.<br>
<div id="console"></div>
<script>
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    function log(message) {
        document.getElementById("console").appendChild(document.createTextNode(message));
    }

    var xhr;    
    function test() {
        xhr = new XMLHttpRequest();
        if (localStorage.reloaded)
            xhr.onload = finish;
        else         
            xhr.onload = reload;
        xhr.open("GET", "resources/print-cache-control-header.cgi", true);
        xhr.send(null);
    }
    
    function reload() {
        localStorage.reloaded = true;
        location.reload(true);
    }
    
    function finish() {
        log(xhr.responseText);
        if (window.testRunner)
            testRunner.notifyDone();
    }
</script>
</body>
</html>
