Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / misc / refresh-headers.php
blob324e3dc3889be6773b6f87911f6ce02570805b62
1 <?php
2 $gotMaxAge=false;
3 $gotNoCache=false;
5 if (0 == strcasecmp($_SERVER["HTTP_CACHE_CONTROL"], "max-age=0"))
7 $gotMaxAge = true;
10 if ((0 == strcasecmp($_SERVER["HTTP_CACHE_CONTROL"], "no-cache")) ||
11 (0 == strcasecmp($_SERVER["HTTP_PRAGMA"], "no-cache")))
13 $gotNoCache = true;
16 if ($gotNoCache) {
17 echo '<p>Got a no-cache directive; FAILURE!</p>';
18 echo '<script>if (window.testRunner) { testRunner.notifyDone(); }</script>';
19 } else if ($gotMaxAge) {
20 echo '<p>SUCCESS</p>';
21 echo '<script>if (window.testRunner) { testRunner.notifyDone(); }</script>';
22 } else {
23 echo '<body onload="window.location.reload();">';
24 echo '<p>No cache control headers, reloading...</p>';
25 echo '<script>if (window.testRunner) { testRunner.waitUntilDone(); }</script>';
26 echo '<script>function test() {window.location.reload();}</script>';
29 echo '<script>if (window.testRunner) { testRunner.dumpAsText(); }</script>';
30 echo '<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=5499">bug 5499</a>: Page reload does not send any cache control headers.</p>';