Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 // test that methods are not normalized
3 const testMethods = [
4 ["GET"],
5 ["get"],
6 ["Get"],
7 ["gET"],
8 ["gEt"],
9 ["post"],
10 ["POST"],
11 ["head"],
12 ["HEAD"],
13 ["put"],
14 ["PUT"],
15 ["delete"],
16 ["DELETE"],
17 ["connect"],
18 ["CONNECT"],
19 ["options"],
20 ["trace"],
21 ["track"],
22 ["copy"],
23 ["index"],
24 ["lock"],
25 ["m-post"],
26 ["mkcol"],
27 ["move"],
28 ["propfind"],
29 ["proppatch"],
30 ["unlock"],
31 ["link"],
32 ["LINK"],
33 ["foo"],
34 ["foO"],
35 ["fOo"],
36 ["Foo"]
37 ]
39 function run_test() {
40 var ios =
41 Cc["@mozilla.org/network/io-service;1"].
42 getService(Ci.nsIIOService);
44 var chan = ios.newChannel("http://localhost/", null, null)
45 .QueryInterface(Components.interfaces.nsIHttpChannel);
47 for (var i = 0; i < testMethods.length; i++) {
48 chan.requestMethod = testMethods[i];
49 do_check_eq(chan.requestMethod, testMethods[i]);
50 }
51 }