michael@0: // test that methods are not normalized michael@0: michael@0: const testMethods = [ michael@0: ["GET"], michael@0: ["get"], michael@0: ["Get"], michael@0: ["gET"], michael@0: ["gEt"], michael@0: ["post"], michael@0: ["POST"], michael@0: ["head"], michael@0: ["HEAD"], michael@0: ["put"], michael@0: ["PUT"], michael@0: ["delete"], michael@0: ["DELETE"], michael@0: ["connect"], michael@0: ["CONNECT"], michael@0: ["options"], michael@0: ["trace"], michael@0: ["track"], michael@0: ["copy"], michael@0: ["index"], michael@0: ["lock"], michael@0: ["m-post"], michael@0: ["mkcol"], michael@0: ["move"], michael@0: ["propfind"], michael@0: ["proppatch"], michael@0: ["unlock"], michael@0: ["link"], michael@0: ["LINK"], michael@0: ["foo"], michael@0: ["foO"], michael@0: ["fOo"], michael@0: ["Foo"] michael@0: ] michael@0: michael@0: function run_test() { michael@0: var ios = michael@0: Cc["@mozilla.org/network/io-service;1"]. michael@0: getService(Ci.nsIIOService); michael@0: michael@0: var chan = ios.newChannel("http://localhost/", null, null) michael@0: .QueryInterface(Components.interfaces.nsIHttpChannel); michael@0: michael@0: for (var i = 0; i < testMethods.length; i++) { michael@0: chan.requestMethod = testMethods[i]; michael@0: do_check_eq(chan.requestMethod, testMethods[i]); michael@0: } michael@0: }