Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>XMLHttpRequest: open() - allowed case in/sensitive methods test</titl e> | |
| 5 </head> | |
| 6 <body> | |
| 7 <p>Valid methods per step-5 of http://xhr.spec.whatwg.org/#the-open()-method .</p> | |
| 8 <div id="log"></div> | |
| 9 <script type="text/javascript"> | |
| 10 if (window.testRunner) | |
|
sof
2014/06/19 06:19:50
I would have preferred if this (new) test used js-
maheshkk
2014/06/19 19:33:53
Done. However dumpAsText is still required though!
| |
| 11 window.testRunner.dumpAsText(); | |
| 12 | |
| 13 function log(message) { | |
| 14 document.getElementById("log").appendChild(document.createTextNode(mes sage)); | |
| 15 document.getElementById("log").appendChild(document.createElement("br" )); | |
| 16 } | |
| 17 function method(method) { | |
|
sof
2014/06/19 06:19:50
How about 'verb' (or methodName) as the argument n
maheshkk
2014/06/19 19:33:52
Ok sure. This code is mostly used as is per w3c-te
| |
| 18 var client = new XMLHttpRequest(); | |
| 19 client.open(method, "resources/request-method.php", false); | |
|
sof
2014/06/19 06:19:49
You could run into test timeout problems here, syn
maheshkk
2014/06/19 19:33:52
Done.
| |
| 20 client.send(null); | |
| 21 log(client.getResponseHeader("x-custom-request-method")); | |
| 22 } | |
| 23 | |
| 24 method("PUT") | |
|
sof
2014/06/19 06:19:50
Add semicolons to these calls.
maheshkk
2014/06/19 19:33:52
Done.
| |
| 25 method("Put") | |
| 26 method("DELETE") | |
| 27 method("DeLeTe") | |
| 28 method("HEAD") | |
| 29 method("hEAd") | |
| 30 method("OPTIONS") | |
| 31 method("OPtiOns") | |
| 32 method("POST") | |
| 33 method("post") | |
| 34 method("GET") | |
| 35 method("gEt") | |
| 36 </script> | |
| 37 </body> | |
| 38 </html> | |
| 39 | |
| OLD | NEW |