Backed out changeset 9c5344d443b6 (bug 1496557) for failing bc browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js a=backout DEVEDITION_63_0b13_BUILD1 DEVEDITION_63_0b13_RELEASE FENNEC_63_0b13_BUILD1 FENNEC_63_0b13_RELEASE FIREFOX_63_0b13_BUILD1 FIREFOX_63_0b13_RELEASE
authorAndreea Pavel <apavel@mozilla.com>
Mon, 08 Oct 2018 18:58:29 +0300
changeset 492852 1e0b0e805d0ad22e0135979511c9a1745b06c380
parent 492851 af52aa2742c445f5d50e0e0d96e7fd9a87f3f662
child 492853 337e9ccc7624242a96d0bca8f1211d28cfe99978
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1496557
milestone63.0
backs out9c5344d443b653afd181ec22c29bd36ec098f95d
Backed out changeset 9c5344d443b6 (bug 1496557) for failing bc browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js a=backout
browser/app/profile/firefox.js
browser/base/content/browser-contentblocking.js
browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1517,19 +1517,16 @@ pref("browser.contentblocking.cookies-si
 pref("browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled", true);
 
 // Enable the Report Breakage UI on Nightly and Beta but not on Release yet.
 #ifdef EARLY_BETA_OR_EARLIER
 pref("browser.contentblocking.reportBreakage.enabled", true);
 #else
 pref("browser.contentblocking.reportBreakage.enabled", false);
 #endif
-// Show report breakage for tracking cookies in all channels.
-pref("browser.contentblocking.rejecttrackers.reportBreakage.enabled", true);
-
 pref("browser.contentblocking.reportBreakage.url", "https://tracking-protection-issues.herokuapp.com/new");
 
 // Content Blocking has a separate pref for the intro count, since the former TP intro
 // was updated when we introduced content blocking and we want people to see it again.
 pref("browser.contentblocking.introCount", 0);
 
 pref("privacy.trackingprotection.introCount", 0);
 pref("privacy.trackingprotection.introURL", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tracking-protection/start/");
--- a/browser/base/content/browser-contentblocking.js
+++ b/browser/base/content/browser-contentblocking.js
@@ -135,17 +135,16 @@ var TrackingProtection = {
 
   isBlockerActivated(state) {
     return state & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT;
   },
 };
 
 var ThirdPartyCookies = {
   PREF_ENABLED: "network.cookie.cookieBehavior",
-  PREF_REPORT_BREAKAGE_ENABLED: "browser.contentblocking.rejecttrackers.reportBreakage.enabled",
   PREF_ENABLED_VALUES: [
     // These values match the ones exposed under the Content Blocking section
     // of the Preferences UI.
     Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN,  // Block all third-party cookies
     Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER,  // Block third-party cookies from trackers
   ],
   PREF_UI_ENABLED: "browser.contentblocking.rejecttrackers.control-center.ui.enabled",
 
@@ -154,18 +153,16 @@ var ThirdPartyCookies = {
     return this.categoryItem =
       document.getElementById("identity-popup-content-blocking-category-3rdpartycookies");
   },
 
   init() {
     XPCOMUtils.defineLazyPreferenceGetter(this, "behaviorPref", this.PREF_ENABLED,
                                           Ci.nsICookieService.BEHAVIOR_ACCEPT);
     XPCOMUtils.defineLazyPreferenceGetter(this, "visible", this.PREF_UI_ENABLED, false);
-    XPCOMUtils.defineLazyPreferenceGetter(this, "reportBreakageEnabled",
-      this.PREF_REPORT_BREAKAGE_ENABLED, false);
   },
   get enabled() {
     return this.PREF_ENABLED_VALUES.includes(this.behaviorPref);
   },
 
   isBlockerActivated(state) {
     return (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER) != 0 ||
            (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_FOREIGN) != 0;
@@ -282,16 +279,24 @@ var ContentBlocking = {
         this.appMenuVerticalSeparator.setAttribute("hidden", "true");
       }
     };
 
     this.updateGlobalToggleVisibility();
 
     Services.prefs.addObserver(this.PREF_GLOBAL_TOGGLE, this.updateGlobalToggleVisibility);
 
+    this.updateReportBreakageUI = () => {
+      this.reportBreakageButton.hidden = !Services.prefs.getBoolPref(this.PREF_REPORT_BREAKAGE_ENABLED);
+    };
+
+    this.updateReportBreakageUI();
+
+    Services.prefs.addObserver(this.PREF_REPORT_BREAKAGE_ENABLED, this.updateReportBreakageUI);
+
     this.updateAnimationsEnabled = () => {
       this.iconBox.toggleAttribute("animationsenabled",
         Services.prefs.getBoolPref(this.PREF_ANIMATIONS_ENABLED, false));
     };
 
     for (let blocker of this.blockers) {
       if (blocker.init) {
         blocker.init();
@@ -299,18 +304,16 @@ var ContentBlocking = {
     }
 
     this.updateAnimationsEnabled();
 
     Services.prefs.addObserver(this.PREF_ANIMATIONS_ENABLED, this.updateAnimationsEnabled);
 
     XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingEnabled", this.PREF_ENABLED, false,
       this.updateEnabled.bind(this));
-    XPCOMUtils.defineLazyPreferenceGetter(this, "reportBreakageEnabled",
-      this.PREF_REPORT_BREAKAGE_ENABLED, false);
     XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingUIEnabled", this.PREF_UI_ENABLED, false,
       this.updateUIEnabled.bind(this));
 
     this.updateEnabled();
     this.updateUIEnabled();
 
     this.activeTooltipText =
       gNavigatorBundle.getString("trackingProtection.icon.activeTooltip");
@@ -321,16 +324,17 @@ var ContentBlocking = {
   uninit() {
     for (let blocker of this.blockers) {
       if (blocker.uninit) {
         blocker.uninit();
       }
     }
 
     Services.prefs.removeObserver(this.PREF_ANIMATIONS_ENABLED, this.updateAnimationsEnabled);
+    Services.prefs.removeObserver(this.PREF_REPORT_BREAKAGE_ENABLED, this.updateReportBreakageUI);
     Services.prefs.removeObserver(this.PREF_GLOBAL_TOGGLE, this.updateGlobalToggleVisibility);
   },
 
   get enabled() {
     return this.contentBlockingUIEnabled ? this.contentBlockingEnabled : TrackingProtection.enabled;
   },
 
   updateEnabled() {
@@ -489,28 +493,16 @@ var ContentBlocking = {
 
     this.content.toggleAttribute("detected", detected);
     this.content.toggleAttribute("hasException", hasException);
     this.content.toggleAttribute("active", active);
 
     this.iconBox.toggleAttribute("active", active);
     this.iconBox.toggleAttribute("hasException", this.enabled && hasException);
 
-    // For release (due to the large volume) we only want to receive reports
-    // for breakage that is directly related to third party cookie blocking.
-    if (this.reportBreakageEnabled ||
-        (ThirdPartyCookies.reportBreakageEnabled &&
-         ThirdPartyCookies.activated &&
-         !FastBlock.activated &&
-         !TrackingProtection.activated)) {
-      this.reportBreakageButton.removeAttribute("hidden");
-    } else {
-      this.reportBreakageButton.setAttribute("hidden", "true");
-    }
-
     if (isSimulated) {
       this.iconBox.removeAttribute("animate");
     } else if (active && webProgress.isTopLevel) {
       this.iconBox.setAttribute("animate", "true");
 
       if (!isBrowserPrivate) {
         let introCount = Services.prefs.getIntPref(this.prefIntroCount);
         if (introCount < this.MAX_INTROS) {
--- a/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
@@ -1,16 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
 const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/benignPage.html";
-const COOKIE_PAGE = "http://not-tracking.example.com/browser/browser/base/content/test/trackingUI/cookiePage.html";
 
 const CB_PREF = "browser.contentblocking.enabled";
 const CB_UI_PREF = "browser.contentblocking.ui.enabled";
 const TP_PREF = "privacy.trackingprotection.enabled";
 const PREF_REPORT_BREAKAGE_ENABLED = "browser.contentblocking.reportBreakage.enabled";
 const PREF_REPORT_BREAKAGE_URL = "browser.contentblocking.reportBreakage.url";
 
 let {HttpServer} = ChromeUtils.import("resource://testing-common/httpd.js", {});
@@ -74,33 +73,21 @@ add_task(async function testReportBreaka
       url: BENIGN_PAGE,
       prefs: {
         "browser.contentblocking.enabled": true,
         "privacy.trackingprotection.enabled": true,
         "browser.contentblocking.reportBreakage.enabled": true,
       },
       buttonVisible: false,
     },
-    {
-      url: COOKIE_PAGE,
-      prefs: {
-        "browser.contentblocking.enabled": true,
-        "browser.fastblock.enabled": false,
-        "privacy.trackingprotection.enabled": false,
-        "network.cookie.cookieBehavior": Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER,
-        "browser.contentblocking.reportBreakage.enabled": false,
-        "browser.contentblocking.rejecttrackers.reportBreakage.enabled": true,
-      },
-      buttonVisible: true,
-    },
   ];
 
   for (let scenario of scenarios) {
     for (let pref in scenario.prefs) {
-      Preferences.set(pref, scenario.prefs[pref]);
+      Services.prefs.setBoolPref(pref, scenario.prefs[pref]);
     }
 
     let uri = Services.io.newURI(scenario.url);
     if (scenario.hasException) {
       Services.perms.add(uri, "trackingprotection", Services.perms.ALLOW_ACTION);
     }
 
     await BrowserTestUtils.withNewTab(scenario.url, async function() {