Bug 1268848 - Safe Browsing preferences graying out inconsistency. r=gpascutto, a=sylvestre
authorRyan Hankins <rhankins@gmail.com>
Tue, 03 May 2016 11:34:59 -0500
changeset 333210 d52c5d23e08d21ae05a9146d5220c0daa728c3a7
parent 333209 085544676bf8767d1f9218873af8e3900df8e8fc
child 333211 014467d4ca30ea196dffb9263ffa7919779949df
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgpascutto, sylvestre
bugs1268848
milestone48.0a2
Bug 1268848 - Safe Browsing preferences graying out inconsistency. r=gpascutto, a=sylvestre
browser/components/preferences/in-content/security.js
browser/components/preferences/in-content/tests/browser_security.js
--- a/browser/components/preferences/in-content/security.js
+++ b/browser/components/preferences/in-content/security.js
@@ -160,17 +160,19 @@ var gSecurityPane = {
     let blockUncommonPref = document.getElementById("browser.safebrowsing.downloads.remote.block_uncommon");
 
     enableSafeBrowsing.addEventListener("command", function() {
       safeBrowsingPhishingPref.value = enableSafeBrowsing.checked;
       safeBrowsingMalwarePref.value = enableSafeBrowsing.checked;
 
       if (enableSafeBrowsing.checked) {
         blockDownloads.removeAttribute("disabled");
-        blockUncommonUnwanted.removeAttribute("disabled");
+        if (blockDownloads.checked) {
+          blockUncommonUnwanted.removeAttribute("disabled");
+        }
       } else {
         blockDownloads.setAttribute("disabled", "true");
         blockUncommonUnwanted.setAttribute("disabled", "true");
       }
     });
 
     blockDownloads.addEventListener("command", function() {
       blockDownloadsPref.value = blockDownloads.checked;
--- a/browser/components/preferences/in-content/tests/browser_security.js
+++ b/browser/components/preferences/in-content/tests/browser_security.js
@@ -38,18 +38,19 @@ add_task(function*() {
 
     // check that both settings are now turned on or off
     is(Services.prefs.getBoolPref("browser.safebrowsing.enabled"), !checked,
        "safebrowsing.enabled is set correctly");
     is(Services.prefs.getBoolPref("browser.safebrowsing.malware.enabled"), !checked,
        "safebrowsing.malware.enabled is set correctly");
 
     // check if the other checkboxes have updated
-    is(blockDownloads.hasAttribute("disabled"), checked, "block downloads checkbox is set correctly");
-    is(blockUncommon.hasAttribute("disabled"), checked, "block uncommon checkbox is set correctly");
+    checked = checkbox.checked;
+    is(blockDownloads.hasAttribute("disabled"), !checked, "block downloads checkbox is set correctly");
+    is(blockUncommon.hasAttribute("disabled"), !checked || !blockDownloads.checked, "block uncommon checkbox is set correctly");
 
     yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
   }
 
   yield checkPrefSwitch(true, true);
   yield checkPrefSwitch(false, true);
   yield checkPrefSwitch(true, false);
   yield checkPrefSwitch(false, false);