2 <body onload=
"setTimeout(test, 100);">
3 This test does the following:
<br>
4 1. Load a page, trigger an XHR.
<br>
5 2. Reload the page.
<br>
6 3. Dump the http readers for the reload of the XHR.
<br><br>
7 The XHR is trigger after onload has fired. There should not be an HTTP_CACHE_CONTROL header forcing reload, so an http cache
8 could load the resource without contacting the server.
<br>
9 The test passes if there is no HTTP_CACHE_CONTROL header displayed below.
<br>
10 <div id=
"console"></div>
12 if (window
.testRunner
) {
13 testRunner
.dumpAsText();
14 testRunner
.waitUntilDone();
17 function log(message
) {
18 document
.getElementById("console").appendChild(document
.createTextNode(message
));
23 xhr
= new XMLHttpRequest();
24 if (localStorage
.reloaded
)
28 xhr
.open("GET", "resources/print-cache-control-header.cgi", true);
33 localStorage
.reloaded
= true;
34 location
.reload(true);
38 log(xhr
.responseText
);
39 if (window
.testRunner
)
40 testRunner
.notifyDone();