Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / access-control-basic-non-simple-allow-async.html
blob15271daa4741dfecfc52463c9397e8edcffa09c6
1 <html>
2 <body>
3 <pre id='console'></pre>
4 <script type="text/javascript">
5 function log(message)
7 document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
10 if (window.testRunner) {
11 testRunner.dumpAsText();
12 testRunner.waitUntilDone();
15 function processStateChange()
17 if (xhr.readyState == xhr.DONE) {
18 log(xhr.responseText);
19 if (window.testRunner)
20 testRunner.notifyDone();
24 function errorHandler()
26 log("FAIL: Network error.");
27 if (window.testRunner)
28 testRunner.notifyDone();
31 var xhr = new XMLHttpRequest;
32 xhr.onreadystatechange = processStateChange;
33 xhr.onerror = errorHandler;
35 xhr.open("PUT", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-non-get-allow.cgi", true);
36 xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8");
37 xhr.send("PASS: PUT data received");
39 </script>
40 </body>
41 </html>