Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-400.html

Issue 21532002: CORS: Handle error HTTP status code 4XX/5XX in preflight requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-400-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-400.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-400.html b/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-400.html
new file mode 100755
index 0000000000000000000000000000000000000000..d59d53586e306e8e675d9ea6ae10e4847bfd311e
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-400.html
@@ -0,0 +1,30 @@
+<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=400");
+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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-invalid-status-400-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698