3 <pre id='console'
></pre>
4 <script type=
"text/javascript">
7 document
.getElementById('console').appendChild(document
.createTextNode(message
+ "\n"));
10 if (window
.testRunner
) {
11 testRunner
.dumpAsText();
12 testRunner
.waitUntilDone();
15 function errorHandler(event
)
17 log("FAIL: Network error. ");
18 if (window
.testRunner
)
19 testRunner
.notifyDone();
22 var filename
= "filename=preflightCacheInvalidationByMethod.txt";
24 var xhr
= new XMLHttpRequest
;
25 xhr
.onerror
= errorHandler
;
29 // Temp file removed. We can start the test now.
30 if (xhr
.readyState
== xhr
.DONE
) {
35 xhr
.open("GET", "/resources/reset-temp-file.php?" + filename
, true);
36 xhr
.onreadystatechange
= start
;
39 function firstRequest()
41 xhr
.onreadystatechange = function()
43 if (xhr
.readyState
== xhr
.DONE
) {
44 log(xhr
.responseText
);
45 log("PASS: First request complete");
50 xhr
.open("PUT", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-preflight-cache-invalidation.php?" + filename
, true);
54 function secondRequest()
56 xhr
.onreadystatechange = function()
58 if (xhr
.readyState
== xhr
.DONE
) {
59 log(xhr
.responseText
);
60 log("PASS: Second request complete");
61 if (window
.testRunner
)
62 testRunner
.notifyDone();
66 // Send a method not included in the initial cache.
67 xhr
.open("XMETHOD", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-preflight-cache-invalidation.php?" + filename
, true);