OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>XMLHttpRequest: open() - allowed case in/sensitive methods test</titl e> | |
5 <script src="../resources/testharness.js"></script> | |
6 <script src="../resources/testharnessreport.js"></script> | |
7 </head> | |
8 <body> | |
9 <p>Valid methods per step-5 of http://xhr.spec.whatwg.org/#the-open()-method .</p> | |
10 <script type="text/javascript"> | |
11 if (window.testRunner) | |
12 window.testRunner.dumpAsText(); | |
tyoshino (SeeGerritForStatus)
2014/06/20 02:13:34
this is included in testharnessreport.js
maheshkk
2014/06/20 04:53:19
Done.
| |
13 | |
14 function testMethod(methodName, lastTest) { | |
tyoshino (SeeGerritForStatus)
2014/06/20 02:13:34
lastTest is not used?
maheshkk
2014/06/20 04:53:19
Done. Had it for async_test usage but got it worki
| |
15 var client = new XMLHttpRequest(); | |
16 client.open(methodName, "resources/request-method.php"); | |
tyoshino (SeeGerritForStatus)
2014/06/20 02:13:34
how about naming this echo-request-method.php?
maheshkk
2014/06/20 04:53:19
Done.
| |
17 client.onreadystatechange = function(event) { | |
18 if (event.target.readyState == 4) | |
19 assert_equals(client.getResponseHeader("x-custom-request-method"), m ethodName.toUpperCase()); | |
20 } | |
21 client.send(null); | |
22 } | |
23 | |
24 test(function() { testMethod("PUT"); }); | |
25 test(function() { testMethod("Put"); }); | |
26 test(function() { testMethod("DELETE"); }); | |
27 test(function() { testMethod("DeLeTe"); }); | |
28 test(function() { testMethod("HEAD"); }); | |
29 test(function() { testMethod("hEAd"); }); | |
30 test(function() { testMethod("OPTIONS"); }); | |
31 test(function() { testMethod("OPtiOns"); }); | |
32 test(function() { testMethod("POST"); }); | |
33 test(function() { testMethod("post"); }); | |
34 test(function() { testMethod("GET"); }); | |
35 test(function() { testMethod("gEt", true); }); | |
36 </script> | |
37 </body> | |
38 </html> | |
39 | |
OLD | NEW |