Bug 843689: make network.IDN.use_whitelist pref default to false preparatory to removing it completely, r=gerv

This commit is contained in:
Simon Montagu 2015-09-16 13:53:18 -07:00
parent 1eacdc7280
commit 83f842a831
2 changed files with 1 additions and 32 deletions

View File

@ -1534,7 +1534,7 @@ pref("network.IDN_show_punycode", false);
// "network.IDN_show_punycode" is false. In other words, all IDNs will be shown
// in punycode if "network.IDN_show_punycode" is true.
pref("network.IDN.restriction_profile", "moderate");
pref("network.IDN.use_whitelist", true);
pref("network.IDN.use_whitelist", false);
// ccTLDs
pref("network.IDN.whitelist.ac", true);

View File

@ -22,35 +22,4 @@ function run_test() {
do_check_eq(idnService.convertACEtoUTF8(reference[i][1]), reference[i][0]);
do_check_eq(idnService.isACE(reference[i][1]), reference[i][2]);
}
// add an IDN whitelist pref
var pbi = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
pbi.setBoolPref("network.IDN.whitelist.es", true);
// After bug 722299, set network.IDN.restriction_profile to "ASCII" in
// order not to change the behaviour of non-whitelisted TLDs
var oldProfile = pbi.getCharPref("network.IDN.restriction_profile", "moderate");
pbi.setCharPref("network.IDN.restriction_profile", "ASCII");
// check convertToDisplayIDN against the whitelist
var isASCII = {};
do_check_eq(idnService.convertToDisplayIDN("b\u00FCcher.es", isASCII), "b\u00FCcher.es");
do_check_eq(isASCII.value, false);
do_check_eq(idnService.convertToDisplayIDN("xn--bcher-kva.es", isASCII), "b\u00FCcher.es");
do_check_eq(isASCII.value, false);
do_check_eq(idnService.convertToDisplayIDN("b\u00FCcher.uk", isASCII), "xn--bcher-kva.uk");
do_check_eq(isASCII.value, true);
do_check_eq(idnService.convertToDisplayIDN("xn--bcher-kva.uk", isASCII), "xn--bcher-kva.uk");
do_check_eq(isASCII.value, true);
// check ACE TLD's are handled by the whitelist
pbi.setBoolPref("network.IDN.whitelist.xn--k-dha", true);
do_check_eq(idnService.convertToDisplayIDN("test.\u00FCk", isASCII), "test.\u00FCk");
do_check_eq(isASCII.value, false);
do_check_eq(idnService.convertToDisplayIDN("test.xn--k-dha", isASCII), "test.\u00FCk");
do_check_eq(isASCII.value, false);
// reset pref to default
pbi.setCharPref("network.IDN.restriction_profile", oldProfile);
}