Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / cache-headers-after-reload.html
blob65ce1e30f5b48c7272048c84df72127b288d9360
1 <html>
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>
11 <script>
12 if (window.testRunner) {
13 testRunner.dumpAsText();
14 testRunner.waitUntilDone();
17 function log(message) {
18 document.getElementById("console").appendChild(document.createTextNode(message));
21 var xhr;
22 function test() {
23 xhr = new XMLHttpRequest();
24 if (localStorage.reloaded)
25 xhr.onload = finish;
26 else
27 xhr.onload = reload;
28 xhr.open("GET", "resources/print-cache-control-header.cgi", true);
29 xhr.send(null);
32 function reload() {
33 localStorage.reloaded = true;
34 location.reload(true);
37 function finish() {
38 log(xhr.responseText);
39 if (window.testRunner)
40 testRunner.notifyDone();
42 </script>
43 </body>
44 </html>