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 function test_uri(obj) {
11 uri = Services.io.newURI(obj.uri);
14 message = obj.uri + " should not be accepted as a valid URI";
19 message = obj.uri + " should be accepted as a valid URI";
26 Assert.ok(uri != null);
27 Assert.equal(uri.spec, obj.uri);
33 { uri: "chrome://blah/content/blah.xul", result: true },
34 { uri: "chrome://blah/content/:/blah/blah.xul", result: true },
35 { uri: "chrome://blah/content/%252e./blah/blah.xul", result: true },
36 { uri: "chrome://blah/content/%252e%252e/blah/blah.xul", result: true },
37 { uri: "chrome://blah/content/blah.xul?param=%252e./blah/", result: true },
38 { uri: "chrome://blah/content/blah.xul?param=:/blah/", result: true },
40 uri: "chrome://blah/content/blah.xul?param=%252e%252e/blah/",
44 for (var i = 0; i < tests.length; ++i) {