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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/access-control-basic-post-success-no-content-type.html

Issue 22601002: Correct the default Content-Type for XHR Post with string data as per XHR specification. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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
Index: LayoutTests/http/tests/xmlhttprequest/access-control-basic-post-success-no-content-type.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin.html b/LayoutTests/http/tests/xmlhttprequest/access-control-basic-post-success-no-content-type.html
similarity index 63%
copy from LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin.html
copy to LayoutTests/http/tests/xmlhttprequest/access-control-basic-post-success-no-content-type.html
index bcf83280d1c9385aa10e3a7cdd5e66228069f86e..134f30bce7d4b4746a9fd63cbe566cab263d877c 100644
--- a/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-headers-origin.html
+++ b/LayoutTests/http/tests/xmlhttprequest/access-control-basic-post-success-no-content-type.html
@@ -1,6 +1,7 @@
<html>
<body>
-<p>Test that 'Origin' is not included in Access-Control-Request-Headers in a preflight request. Should print PASS.</p>
+<p>Test that POST requests with text content and no content-type set explicitly<br>doesn't generate a preflight request.
+Should print PASS.</p>
<div id="log"></div>
<script>
function log(message) {
@@ -13,21 +14,20 @@ if (window.layoutTestController) {
}
var xhr = new XMLHttpRequest();
-xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-request-headers-origin.php");
-xhr.setRequestHeader("X-Custom-Header", "PASS");
+
+xhr.open("POST", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-post-success-no-content-type.php");
xhr.onerror = function () {
log("FAIL");
if (window.layoutTestController)
layoutTestController.notifyDone();
};
-xhr.onreadystatechange = function () {
+xhr.onload = function () {
if (xhr.readyState == 4) {
log(xhr.responseText);
if (window.layoutTestController)
layoutTestController.notifyDone();
}
};
-xhr.send();
-
+xhr.send('Test');
</script>
</html>

Powered by Google App Engine
This is Rietveld 408576698