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/. */
5 // Ensure that non-16-bit URIs are rejected
11 "@mozilla.org/network/standard-url-mutator;1"
12 ].createInstance(Ci.nsIURIMutator);
13 Assert.ok(mutator, "Mutator constructor works");
15 let url = Cc["@mozilla.org/network/standard-url-mutator;1"]
16 .createInstance(Ci.nsIStandardURLMutator)
18 Ci.nsIStandardURL.URLTYPE_AUTHORITY,
26 // Bug 1301621 makes invalid ports throw
29 url = Cc["@mozilla.org/network/standard-url-mutator;1"]
30 .createInstance(Ci.nsIStandardURLMutator)
32 Ci.nsIStandardURL.URLTYPE_AUTHORITY,
40 /NS_ERROR_MALFORMED_URI/,
41 "invalid port during creation"
48 .QueryInterface(Ci.nsIStandardURLMutator)
49 .setDefaultPort(65536)
52 /NS_ERROR_MALFORMED_URI/,
53 "invalid port in setDefaultPort"
57 url = url.mutate().setPort(65536).finalize();
59 /NS_ERROR_MALFORMED_URI/,
60 "invalid port in port setter"
63 Assert.equal(url.port, -1);