1 const Cc
= Components
.classes
;
2 const Ci
= Components
.interfaces
;
5 const ios
= Cc
["@mozilla.org/network/io-service;1"].
6 getService(Ci
.nsIIOService
);
8 var uri
= ios
.newURI("http://foo.com/file.txt", null, null);
10 do_check_eq(uri
.hostPort
, "foo.com:90");
12 uri
= ios
.newURI("http://foo.com:10/file.txt", null, null);
14 do_check_eq(uri
.hostPort
, "foo.com:500");
16 uri
= ios
.newURI("http://foo.com:5000/file.txt", null, null);
18 do_check_eq(uri
.hostPort
, "foo.com:20");
20 uri
= ios
.newURI("http://foo.com:5000/file.txt", null, null);
22 do_check_eq(uri
.hostPort
, "foo.com");
24 uri
= ios
.newURI("http://foo.com:5000/file.txt", null, null);
26 do_check_eq(uri
.hostPort
, "foo.com");