Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / access-control-preflight-request-invalid-status-301.html
blobc0eb272c6af137c852cbcfe92d05955a1446712a
1 <html>
2 <body>
3 <p>Test that preflight requests with invalid status code results in error. Should print PASS.</p>
4 <div id="log"></div>
5 <script>
6 function log(message) {
7 document.getElementById("log").innerHTML += message + "<br>";
10 if (window.layoutTestController) {
11 layoutTestController.dumpAsText();
12 layoutTestController.waitUntilDone();
15 var xhr = new XMLHttpRequest();
16 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-request-invalid-status.php?code=301");
17 xhr.setRequestHeader("X-Custom-Header", "PASS");
18 xhr.onerror = function () {
19 log("PASS");
20 if (window.layoutTestController)
21 layoutTestController.notifyDone();
23 xhr.onload = function () {
24 log("FAIL");
25 if (window.layoutTestController)
26 layoutTestController.notifyDone();
28 xhr.send();
29 </script>
30 </html>