Bug 1380617 - Fix tests that use nsIURI.host expecting unicode domain name r=smaug,honzab
MozReview-Commit-ID: GKnbpc8GMb2
--- a/docshell/test/unit/test_nsDefaultURIFixup_info.js
+++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js
@@ -332,18 +332,18 @@ var testcases = [ {
protocolChange: true,
}, {
input: "http://whitelisted/",
fixedURI: "http://whitelisted/",
alternateURI: "http://www.whitelisted.com/",
inWhitelist: true,
}, {
input: "café.local",
- fixedURI: "http://café.local/",
- alternateURI: "http://www.café.local/",
+ fixedURI: "http://xn--caf-dma.local/",
+ alternateURI: "http://www.xn--caf-dma.local/",
protocolChange: true
}, {
input: "47.6182,-122.830",
fixedURI: "http://47.6182,-122.830/",
keywordLookup: true,
protocolChange: true,
affectedByDNSForSingleHosts: true,
}, {
--- a/dom/tests/mochitest/dom-level0/test_setting_document.domain_idn.html
+++ b/dom/tests/mochitest/dom-level0/test_setting_document.domain_idn.html
@@ -101,19 +101,17 @@ function receiveMessage(evt)
//
// These two tests should illustrate what currently happens and what should
// happen once bug 414090 is fixed.
todo_is(evt.origin, "http://sub1.exaмple.test", "wrong sender");
todo_isnot(evt.origin, "http://sub1.xn--exaple-kqf.test", "wrong sender");
}
else
{
- // We're receiving data from the Greek IDN name; since that TLD is
- // whitelisted for now, the domain we get isn't going to be punycoded.
- is(evt.origin, "http://sub1.παράδειγμα.δοκιμή", "wrong sender");
+ is(evt.origin, "http://sub1.xn--hxajbheg2az3al.xn--jxalpdlp", "wrong sender");
}
is(messages[state] + "-response", evt.data.split(" ")[0],
"unexpected data: " + evt.data);
switch (messages[state])
{
case "idn-whitelist":
--- a/netwerk/test/unit/test_bug396389.js
+++ b/netwerk/test/unit/test_bug396389.js
@@ -51,21 +51,21 @@ function run_test() {
prefs.setBoolPref(pref.name, pref.newVal);
}
try {
// URI stolen from
// http://lists.w3.org/Archives/Public/public-iri/2004Mar/0012.html
var uri4 = ios.newURI("http://xn--jos-dma.example.net.ch/");
do_check_eq(uri4.asciiHost, "xn--jos-dma.example.net.ch");
- do_check_eq(uri4.host, "jos\u00e9.example.net.ch");
+ do_check_eq(uri4.displayHost, "jos\u00e9.example.net.ch");
var uri5 = round_trip(uri4);
do_check_true(uri4.equals(uri5));
- do_check_eq(uri4.host, uri5.host);
+ do_check_eq(uri4.displayHost, uri5.displayHost);
do_check_eq(uri4.asciiHost, uri5.asciiHost);
} finally {
for (var pref of prefData) {
if (prefs.prefHasUserValue(pref.name))
prefs.clearUserPref(pref.name);
}
}
}
--- a/security/manager/ssl/tests/unit/test_cert_overrides.js
+++ b/security/manager/ssl/tests/unit/test_cert_overrides.js
@@ -261,17 +261,17 @@ function add_simple_tests() {
// At this point, the override for bug413909.xn--hxajbheg2az3al.xn--jxalpdlp
// is still valid. Do some additional tests relating to IDN handling.
let certOverrideService = Cc["@mozilla.org/security/certoverride;1"]
.getService(Ci.nsICertOverrideService);
let uri = Services.io.newURI("https://bug413909.xn--hxajbheg2az3al.xn--jxalpdlp");
let cert = constructCertFromFile("bad_certs/idn-certificate.pem");
Assert.ok(certOverrideService.hasMatchingOverride(uri.asciiHost, 8443, cert, {}, {}),
"IDN certificate should have matching override using ascii host");
- Assert.ok(!certOverrideService.hasMatchingOverride(uri.host, 8443, cert, {}, {}),
+ Assert.ok(!certOverrideService.hasMatchingOverride(uri.displayHost, 8443, cert, {}, {}),
"IDN certificate should not have matching override using (non-ascii) host");
run_next_test();
});
}
function add_localhost_tests() {
add_cert_override_test("localhost",
Ci.nsICertOverrideService.ERROR_MISMATCH |