| <body> |
| <h1></h1> |
| <script> |
| // Test that a subresource fetched after onload, following a reload, is |
| // not cached if we configure the page's settings to bypass the memory cache. |
| if (!sessionStorage.lastRandom) { |
| if (window.testRunner && window.internals) { |
| internals.settings.setUsesMemoryCache(false); |
| testRunner.dumpResourceLoadCallbacks(); |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| } |
| |
| function done(result) |
| { |
| delete sessionStorage.lastRandom; |
| |
| document.body.innerText = result; |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| |
| function scriptLoaded() |
| { |
| setTimeout(function() |
| { |
| if (!window.randomNumber) |
| done('FAIL: window.randomNumber not defined!'); |
| else if (sessionStorage.lastRandom) { |
| // We don't want to compare the actual random numbers because |
| // the request may or may not be cached by the network stack. |
| done('FINISHED LOADING'); |
| } else { |
| sessionStorage.lastRandom = randomNumber; |
| location.reload(); |
| } |
| }, 0); |
| } |
| |
| onload = function() |
| { |
| setTimeout(function() |
| { |
| var s = document.createElement("script"); |
| s.src = "resources/random-cached.cgi"; |
| s.onload = scriptLoaded; |
| document.body.appendChild(s); |
| }, 0); |
| }; |
| </script> |
| </body> |