Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 /* verify that certain invalid URIs are not parsed by the resource
2 protocol handler */
4 const specs = [
5 "resource:////",
6 "resource:///http://www.mozilla.org/",
7 "resource:///file:///",
8 "resource:///..\\",
9 "resource:///..\\..\\",
10 "resource:///..%5C",
11 "resource:///..%5c"
12 ];
14 function check_for_exception(spec)
15 {
16 var ios =
17 Cc["@mozilla.org/network/io-service;1"].
18 getService(Ci.nsIIOService);
20 try {
21 var channel = ios.newChannel(spec, null, null);
22 }
23 catch (e) {
24 return;
25 }
27 do_throw("Successfully opened invalid URI: '" + spec + "'");
28 }
30 function run_test() {
31 for each (spec in specs) {
32 check_for_exception(spec);
33 }
34 }