JS Test Harness: Remove successfullyParsed from more tests
[WebKit-https.git] / LayoutTests / http / tests / cache / subresource-multiple-instances.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test Caching "no-store" For History Only</title>
5 <script src="../../js-test-resources/js-test-pre.js"></script>
6 </head>
7 <body>
8 <p>Verifies that resources are loaded only once during the initial document
9 load, but are reloaded if they are requested again later and can not be cached.
10 </p>
11 <pre id="console"></pre>
12 <script>
13 if (window.layoutTestController) {
14     layoutTestController.dumpAsText();
15 }
16 var randomNumber = 0;
17 var firstRandomNumber = 0;
18 var secondRandomNumber = 0;
19 var thirdRandomNumber = 0;
20 function firstLoaded() {
21     firstRandomNumber = randomNumber;
22     var newScript = document.createElement("script");
23     newScript.src = "resources/cache-simulator.cgi?uniqueId=1&Cache-control=max-age=0";
24     newScript.onload = secondLoaded;
25     document.getElementsByTagName("head")[0].appendChild(newScript);
26 }
27 function secondLoaded() {
28     secondRandomNumber = randomNumber;
29 }
30 function loadNextScript() {
31     var newScript = document.createElement("script");
32     newScript.src = "resources/cache-simulator.cgi?uniqueId=1&Cache-control=max-age=0";
33     newScript.onload = thirdLoaded;
34     document.getElementsByTagName("head")[0].appendChild(newScript);
35 }
36 function thirdLoaded() {
37     thirdRandomNumber = randomNumber;
38     shouldBeNonZero("firstRandomNumber");
39     shouldBeNonZero("secondRandomNumber");
40     shouldBeNonZero("thirdRandomNumber");
41     shouldBeTrue("firstRandomNumber == secondRandomNumber");
42     shouldBeTrue("firstRandomNumber != thirdRandomNumber");
43     finishJSTest();
44 }
45 window.addEventListener("load", function() { setTimeout(loadNextScript, 0); }, false);
46 var jsTestIsAsync = true;
47 </script>
48 <script src="resources/cache-simulator.cgi?uniqueId=1&Cache-control=max-age=0" onload="firstLoaded()" async></script>
49 <script src="../../js-test-resources/js-test-post.js"></script>
50 </body>
51 </html>