Bug 843689: make network.IDN.use_whitelist pref default to false preparatory to removing it completely, r=gerv
authorSimon Montagu <smontagu@smontagu.org>
Wed, 16 Sep 2015 13:53:18 -0700
changeset 297308 800c270461494640eba7ee5f0f66c8290200375a
parent 297307 dbac0162aeea03297b247a15d3c17751ad035960
child 297309 7d9e6debd7e7e2cd4e20a96fb0aae0829cf364eb
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerv
bugs843689
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 843689: make network.IDN.use_whitelist pref default to false preparatory to removing it completely, r=gerv
modules/libpref/init/all.js
netwerk/test/unit/test_idnservice.js
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1529,17 +1529,17 @@ pref("network.IDN_show_punycode", false)
 // profile is used.
 // If "network.IDN.restriction_profile" is "moderate", the Moderately
 // Restrictive profile is used.
 // In all other cases, the ASCII-Only profile is used.
 // Note that these preferences are referred to ONLY when
 // "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);
 pref("network.IDN.whitelist.ar", true);
 pref("network.IDN.whitelist.at", true);
 pref("network.IDN.whitelist.br", true);
 pref("network.IDN.whitelist.ca", true);
 pref("network.IDN.whitelist.ch", true);
--- a/netwerk/test/unit/test_idnservice.js
+++ b/netwerk/test/unit/test_idnservice.js
@@ -17,40 +17,9 @@ function run_test() {
      // - Converting UTF-8 to ACE and back gives us the expected answer
      // - Converting the ASCII string UTF-8 -> ACE leaves the string unchanged
      // - isACE returns true when we expect it to (third array elem true)
      do_check_eq(idnService.convertUTF8toACE(reference[i][0]), reference[i][1]);
      do_check_eq(idnService.convertUTF8toACE(reference[i][1]), reference[i][1]);
      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);
 }