| Index: LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-501.html
|
| diff --git a/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-501.html b/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-501.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ab4d627093f8d335449b90c9e20ca0dc05c38d43
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-501.html
|
| @@ -0,0 +1,31 @@
|
| +<html>
|
| +<body>
|
| +<p>Test that preflight requests with invalid status code results in error. Should print PASS.</p>
|
| +<div id="log"></div>
|
| +<script>
|
| +function log(message) {
|
| + document.getElementById("log").innerHTML += message + "<br>";
|
| +}
|
| +
|
| +if (window.layoutTestController) {
|
| + layoutTestController.dumpAsText();
|
| + layoutTestController.waitUntilDone();
|
| +}
|
| +
|
| +var xhr = new XMLHttpRequest();
|
| +
|
| +xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-request-invalid-status.php?code=501");
|
| +xhr.setRequestHeader("X-Custom-Header", "PASS");
|
| +xhr.onerror = function () {
|
| + log("PASS");
|
| + if (window.layoutTestController)
|
| + layoutTestController.notifyDone();
|
| +};
|
| +xhr.onload = function () {
|
| + log("FAIL");
|
| + if (window.layoutTestController)
|
| + layoutTestController.notifyDone();
|
| +};
|
| +xhr.send();
|
| +</script>
|
| +</html>
|
|
|