Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / access-control-basic-denied-preflight-cache.html
blobb7e621ca376e1e0f71968de94142b4482d8a5418
1 <html>
2 <body>
3 <p>Test async xhr preflight cache denial. If this test passes, there should be a single PASS below.</p>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
10 var console_messages = document.createElement("ul");
11 document.body.appendChild(console_messages);
13 function log(message)
15 var item = document.createElement("li");
16 item.appendChild(document.createTextNode(message));
17 console_messages.appendChild(item);
20 xhr = new XMLHttpRequest;
21 xhr.onreadystatechange = processStateChange;
22 try {
23 xhr.open("FOO", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-denied.cgi");
24 xhr.send();
25 } catch (e) {
26 log("Got exception.");
29 function processStateChange() {
30 if (xhr.readyState == 1)
31 log("PASS");
32 else if (xhr.readyState == 4) {
33 if (window.testRunner)
34 testRunner.notifyDone();
37 </script>
38 </body>
39 </html>