Bug 1410522 - Enable download protection on non-official builds too. r?gcp,r?johannh draft
authorFrancois Marier <francois@mozilla.com>
Mon, 29 Jan 2018 15:51:14 -0800
changeset 748554 9676d78eba4552275cd8d9c0f3ee6832ead789c0
parent 748403 117e0c0d1ebe2cf5bdffc3474744add2416fc511
push id97204
push userfmarier@mozilla.com
push dateTue, 30 Jan 2018 00:05:11 +0000
reviewersgcp, johannh
bugs1410522, 1394053
milestone60.0a1
Bug 1410522 - Enable download protection on non-official builds too. r?gcp,r?johannh This reverts the change introduced in bug 1394053. Google has made the download protection lists available to everyone and so we no longer need to restrict the download protection feature to official builds. MozReview-Commit-ID: CQcG5Ip1mDV
browser/components/preferences/in-content/privacy.xul
browser/components/preferences/in-content/tests/browser_security-1.js
browser/components/preferences/in-content/tests/browser_security-2.js
modules/libpref/init/all.js
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -615,21 +615,19 @@
     <checkbox id="enableSafeBrowsing"
               label="&enableSafeBrowsing.label;"
               class="tail-with-learn-more"
               accesskey="&enableSafeBrowsing.accesskey;" />
     <label id="enableSafeBrowsingLearnMore"
            class="learnMore text-link">&enableSafeBrowsingLearnMore.label;</label>
   </hbox>
   <vbox class="indent">
-#ifdef MOZILLA_OFFICIAL
     <checkbox id="blockDownloads"
               label="&blockDownloads.label;"
               accesskey="&blockDownloads.accesskey;" />
-#endif
     <checkbox id="blockUncommonUnwanted"
               label="&blockUncommonAndUnwanted.label;"
               accesskey="&blockUncommonAndUnwanted.accesskey;" />
   </vbox>
 </groupbox>
 
 <!-- Certificates -->
 <groupbox id="certSelection" data-category="panePrivacy" hidden="true">
--- a/browser/components/preferences/in-content/tests/browser_security-1.js
+++ b/browser/components/preferences/in-content/tests/browser_security-1.js
@@ -35,21 +35,17 @@ add_task(async function() {
     gBrowser.reload();
     await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
     let doc = gBrowser.selectedBrowser.contentDocument;
     let checkbox = doc.getElementById("enableSafeBrowsing");
     let blockDownloads = doc.getElementById("blockDownloads");
     let blockUncommon = doc.getElementById("blockUncommonUnwanted");
     let checked = checkbox.checked;
-    if (!AppConstants.MOZILLA_OFFICIAL) {
-      is(blockDownloads, undefined, "downloads protection is disabled in un-official builds");
-    } else {
-      is(blockDownloads.hasAttribute("disabled"), !checked, "block downloads checkbox is set correctly");
-    }
+    is(blockDownloads.hasAttribute("disabled"), !checked, "block downloads checkbox is set correctly");
 
     is(checked, val1 && val2, "safebrowsing preference is initialized correctly");
     // should be disabled when checked is false (= pref is turned off)
     is(blockUncommon.hasAttribute("disabled"), !checked, "block uncommon checkbox is set correctly");
 
     // scroll the checkbox into the viewport and click checkbox
     checkbox.scrollIntoView();
     // eslint-disable-next-line mozilla/no-cpows-in-tests
--- a/browser/components/preferences/in-content/tests/browser_security-2.js
+++ b/browser/components/preferences/in-content/tests/browser_security-2.js
@@ -31,20 +31,16 @@ add_task(async function() {
   async function checkPrefSwitch(val) {
     Services.prefs.setBoolPref("browser.safebrowsing.downloads.enabled", val);
 
     gBrowser.reload();
     await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
     let doc = gBrowser.selectedBrowser.contentDocument;
     let checkbox = doc.getElementById("blockDownloads");
-    if (!AppConstants.MOZILLA_OFFICIAL) {
-      is(checkbox, undefined, "downloads protection is disabled in un-official builds");
-      return;
-    }
 
     let blockUncommon = doc.getElementById("blockUncommonUnwanted");
     let checked = checkbox.checked;
     is(checked, val, "downloads preference is initialized correctly");
     // should be disabled when val is false (= pref is turned off)
     is(blockUncommon.hasAttribute("disabled"), !val, "block uncommon checkbox is set correctly");
 
     // scroll the checkbox into view, otherwise the synthesizeMouseAtCenter will be ignored, and click it
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5447,21 +5447,17 @@ pref("browser.safebrowsing.allowOverride
 // Any changes must be coordinated with them.
 #ifdef MOZILLA_OFFICIAL
 pref("browser.safebrowsing.id", "navclient-auto-ffox");
 #else
 pref("browser.safebrowsing.id", "Firefox");
 #endif
 
 // Download protection
-#ifdef MOZILLA_OFFICIAL
 pref("browser.safebrowsing.downloads.enabled", true);
-#else
-pref("browser.safebrowsing.downloads.enabled", false);
-#endif
 pref("browser.safebrowsing.downloads.remote.enabled", true);
 pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
 pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 pref("browser.safebrowsing.downloads.remote.block_dangerous",            true);
 pref("browser.safebrowsing.downloads.remote.block_dangerous_host",       true);
 pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", true);
 pref("browser.safebrowsing.downloads.remote.block_uncommon",             true);