1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 var gIOS = Cc["@mozilla.org/network/io-service;1"]
7 .getService(Ci.nsIIOService);
15 uri = gIOS.newURI(obj.uri, null, null);
18 message = obj.uri + " should not be accepted as a valid URI";
24 message = obj.uri + " should be accepted as a valid URI";
30 do_check_true(uri != null);
31 do_check_eq(uri.spec, obj.uri);
38 {uri: "chrome://blah/content/blah.xul", result: true},
39 {uri: "chrome://blah/content/:/blah/blah.xul", result: false},
40 {uri: "chrome://blah/content/%252e./blah/blah.xul", result: false},
41 {uri: "chrome://blah/content/%252e%252e/blah/blah.xul", result: false},
42 {uri: "chrome://blah/content/blah.xul?param=%252e./blah/", result: true},
43 {uri: "chrome://blah/content/blah.xul?param=:/blah/", result: true},
44 {uri: "chrome://blah/content/blah.xul?param=%252e%252e/blah/", result: true},
46 for (var i = 0; i < tests.length; ++ i)