mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
add unit test for bug 402013.
This commit is contained in:
parent
f840924682
commit
eaf4410e8d
@ -80,4 +80,15 @@ function run_test() {
|
||||
} catch(e) {
|
||||
do_check_eq(e.result, NS_ERROR_HOST_IS_IP_ADDRESS);
|
||||
}
|
||||
|
||||
// check normalization: output should be consistent with
|
||||
// nsIURI::GetAsciiHost(), i.e. lowercased and ASCII/ACE encoded
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
|
||||
var uri = ioService.newURI("http://b\u00FCcher.co.uk", null, null);
|
||||
do_check_eq(tld.getBaseDomain(uri), "xn--bcher-kva.co.uk");
|
||||
do_check_eq(tld.getBaseDomainFromHost("b\u00FCcher.co.uk"), "xn--bcher-kva.co.uk");
|
||||
do_check_eq(tld.getPublicSuffix(uri), "co.uk");
|
||||
do_check_eq(tld.getPublicSuffixFromHost("b\u00FCcher.co.uk"), "co.uk");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user