3 <p>Test that preflight requests with invalid status code results in error. Should print PASS.
</p>
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();
17 xhr
.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-request-invalid-status.php?code=501");
18 xhr
.setRequestHeader("X-Custom-Header", "PASS");
19 xhr
.onerror = function () {
21 if (window
.layoutTestController
)
22 layoutTestController
.notifyDone();
24 xhr
.onload = function () {
26 if (window
.layoutTestController
)
27 layoutTestController
.notifyDone();