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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="/js-test-resources/js-test.js"></script>
4 </head>
5 <body>
6 <script>
7 description("Test that open() converts only special request methods to upper case, per http://xhr.spec.whatwg.org/#dom-xmlhttprequest-open");
8 var req;
9 if (window.testRunner)
10 testRunner.dumpAsText();
11
12 function testMethod(method, expected, noBody) {
13 req = new XMLHttpRequest;
14 req.open(method, "method-name.cgi", false);
15 req.send("");
16 shouldBeEqualToString("req.getResponseHeader('x-request-method')", expecte d);
17 if (!noBody) {
18 shouldBeEqualToString("req.responseText", expected);
19 }
20 req = null;
21 }
22
23 debug("Known methods to be converted to upper-case");
24 testMethod("DeleTe", "DELETE");
25 testMethod("gET", "GET");
26 testMethod("heaD", "HEAD", true);
27 testMethod("oPTioNS", "OPTIONS");
28 testMethod("Post", "POST");
29 testMethod("put", "PUT");
30
31 debug("Other methods should be sent as-is");
32 testMethod("pAtCH", "pAtCH");
33 testMethod("XuniCORn", "XuniCORn");
34 testMethod("LOck", "LOck");
35 testMethod("LOck", "LOck");
36 testMethod("unLOCK", "unLOCK");
37 testMethod("m-post", "m-post");
38 testMethod("iNdex", "iNdex");
39 </script>
40 </body>
41 </html>
OLDNEW
« 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