michael@0: const testURLs = [ michael@0: ["http://example.com/<", "http://example.com/%3C"], michael@0: ["http://example.com/>", "http://example.com/%3E"], michael@0: ["http://example.com/'", "http://example.com/%27"], michael@0: ["http://example.com/\"", "http://example.com/%22"], michael@0: ["http://example.com/?<", "http://example.com/?%3C"], michael@0: ["http://example.com/?>", "http://example.com/?%3E"], michael@0: ["http://example.com/?'", "http://example.com/?%27"], michael@0: ["http://example.com/?\"", "http://example.com/?%22"] michael@0: ] michael@0: michael@0: function run_test() { michael@0: var ioServ = michael@0: Cc["@mozilla.org/network/io-service;1"]. michael@0: getService(Ci.nsIIOService); michael@0: michael@0: for (var i = 0; i < testURLs.length; i++) { michael@0: var uri = ioServ.newURI(testURLs[i][0], null, null); michael@0: do_check_eq(uri.spec, testURLs[i][1]); michael@0: } michael@0: }