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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/method-names.html

Issue 262173002: Reduce method names converted to upper case via uppercaseKnownHTTPMethod() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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/method-names.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/method-names.html b/LayoutTests/http/tests/xmlhttprequest/method-names.html
new file mode 100644
index 0000000000000000000000000000000000000000..c3a4bcec92344dfba8b646513d5ff2bedb0c4cda
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/method-names.html
@@ -0,0 +1,41 @@
+<html>
+<head>
+ <script src="/js-test-resources/js-test.js"></script>
+</head>
+<body>
+<script>
+ description("Test that open() converts only special request methods to uppercase, per http://xhr.spec.whatwg.org/#dom-xmlhttprequest-open");
+ var req;
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function testMethod(method, expected, noBody) {
+ req = new XMLHttpRequest;
+ req.open(method, "method-name.cgi", false);
+ req.send("");
+ shouldBeEqualToString("req.getResponseHeader('x-request-method')", expected);
+ if (!noBody) {
+ shouldBeEqualToString("req.responseText", expected);
+ }
+ req = null;
+ }
+
+ debug("Known methods to be converted to upper-case");
+ testMethod("DeleTe", "DELETE");
+ testMethod("gET", "GET");
+ testMethod("heaD", "HEAD", true);
+ testMethod("oPTioNS", "OPTIONS");
+ testMethod("Post", "POST");
+ testMethod("put", "PUT");
+
+ debug("Other methods should be sent as-is");
+ testMethod("pAtCH", "pAtCH");
+ testMethod("XuniCORn", "XuniCORn");
+ testMethod("LOck", "LOck");
+ testMethod("LOck", "LOck");
+ testMethod("unLOCK", "unLOCK");
+ testMethod("m-post", "m-post");
+ testMethod("iNdex", "iNdex");
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/method-name.cgi ('k') | LayoutTests/http/tests/xmlhttprequest/method-names-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698