Backed out 1 changesets (bug 1480450) for mochitest/test_trackingprotection_bug1157081.html failures CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Mon, 13 Aug 2018 22:45:37 +0300
changeset 486395 3049a5cc847bf692e3f1d9e69837d1b03c918a8f
parent 486394 ec15fcd87b3825b08c31601091a57a921cddaf20
child 486396 5373497f3c4ed10f2511cda855dab8ac31a3979c
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1480450, 1157081
milestone63.0a1
backs out34d3b10c54ebd19d277f23684fb651688c0ef68c
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
Backed out 1 changesets (bug 1480450) for mochitest/test_trackingprotection_bug1157081.html failures CLOSED TREE Backed out changeset 34d3b10c54eb (bug 1480450)
docshell/base/nsDocShell.cpp
toolkit/components/url-classifier/SafeBrowsing.jsm
toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -13110,33 +13110,30 @@ nsDocShell::GetNestedFrameId(uint64_t* a
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetUseTrackingProtection(bool* aUseTrackingProtection)
 {
   *aUseTrackingProtection  = false;
 
-  static bool sCBEnabled = false;
   static bool sTPEnabled = false;
   static bool sTPInPBEnabled = false;
   static bool sPrefsInit = false;
 
   if (!sPrefsInit) {
     sPrefsInit = true;
-    Preferences::AddBoolVarCache(&sCBEnabled,
-      "browser.contentblocking.enabled", true);
     Preferences::AddBoolVarCache(&sTPEnabled,
       "privacy.trackingprotection.enabled", false);
     Preferences::AddBoolVarCache(&sTPInPBEnabled,
       "privacy.trackingprotection.pbmode.enabled", false);
   }
 
-  if (mUseTrackingProtection || (sCBEnabled && sTPEnabled) ||
-      (sCBEnabled && UsePrivateBrowsing() && sTPInPBEnabled)) {
+  if (mUseTrackingProtection || sTPEnabled ||
+      (UsePrivateBrowsing() && sTPInPBEnabled)) {
     *aUseTrackingProtection = true;
     return NS_OK;
   }
 
   RefPtr<nsDocShell> parent = GetParentDocshell();
   if (parent) {
     return parent->GetUseTrackingProtection(aUseTrackingProtection);
   }
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -55,17 +55,16 @@ const tablePreferences = [
 var SafeBrowsing = {
 
   init() {
     if (this.initialized) {
       log("Already initialized");
       return;
     }
 
-    Services.prefs.addObserver("browser.contentblocking.enabled", this);
     Services.prefs.addObserver("browser.safebrowsing", this);
     Services.prefs.addObserver("privacy.trackingprotection", this);
     Services.prefs.addObserver("urlclassifier", this);
     Services.prefs.addObserver("plugins.flashBlock.enabled", this);
     Services.prefs.addObserver("plugins.show_infobar", this);
 
     this.readPrefs();
     this.addMozEntries();
@@ -226,23 +225,21 @@ var SafeBrowsing = {
 
     this.readPrefs();
   },
 
   readPrefs() {
     loggingEnabled = Services.prefs.getBoolPref(PREF_DEBUG_ENABLED);
     log("reading prefs");
 
-    let contentBlockingEnabled = Services.prefs.getBoolPref("browser.contentblocking.enabled", true);
-
     this.phishingEnabled = Services.prefs.getBoolPref("browser.safebrowsing.phishing.enabled");
     this.malwareEnabled = Services.prefs.getBoolPref("browser.safebrowsing.malware.enabled");
     this.downloadsEnabled = Services.prefs.getBoolPref("browser.safebrowsing.downloads.enabled");
     this.passwordsEnabled = Services.prefs.getBoolPref("browser.safebrowsing.passwords.enabled");
-    this.trackingEnabled = contentBlockingEnabled && (Services.prefs.getBoolPref("privacy.trackingprotection.enabled") || Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled"));
+    this.trackingEnabled = Services.prefs.getBoolPref("privacy.trackingprotection.enabled") || Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled");
     this.blockedEnabled = Services.prefs.getBoolPref("browser.safebrowsing.blockedURIs.enabled");
     this.trackingAnnotations = Services.prefs.getBoolPref("privacy.trackingprotection.annotate_channels");
     this.flashBlockEnabled = Services.prefs.getBoolPref("plugins.flashBlock.enabled");
     this.flashInfobarListEnabled = Services.prefs.getBoolPref("plugins.show_infobar", false);
 
     let flashAllowTable, flashAllowExceptTable, flashTable,
         flashExceptTable, flashSubDocTable,
         flashSubDocExceptTable;
--- a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
@@ -99,21 +99,19 @@ function checkLoads(aWindow, aBlocked) {
     }
 
     allNodeMatch = allNodeMatch && nodeMatch;
   }
   is(allNodeMatch, aBlocked, "All tracking nodes are expected to be annotated as such");
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set": [
-      ["browser.contentblocking.enabled", true],
-      ["privacy.trackingprotection.enabled", false],
-      ["privacy.trackingprotection.pbmode.enabled", true],
-  ]}, test);
+  {"set": [["privacy.trackingprotection.enabled", false],
+           ["privacy.trackingprotection.pbmode.enabled", true]]},
+  test);
 
 async function test() {
   SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
   await UrlClassifierTestUtils.addTestTrackers();
 
   // Normal mode, with the pref (trackers should be loaded)
   await testOnWindow(false).then(function(aWindow) {
     checkLoads(aWindow, false);
@@ -127,25 +125,16 @@ async function test() {
   });
 
   // Private Browsing, without the pref (trackers should be loaded)
   await SpecialPowers.setBoolPref("privacy.trackingprotection.pbmode.enabled", false);
   await testOnWindow(true).then(function(aWindow) {
     checkLoads(aWindow, false);
     aWindow.close();
   });
-
-  // Private Browsing, without the content blocking pref (trackers should be loaded)
-  await SpecialPowers.setBoolPref("privacy.trackingprotection.pbmode.enabled", true);
-  await SpecialPowers.setBoolPref("browser.contentblocking.enabled", false);
-  await testOnWindow(true).then(function(aWindow) {
-    checkLoads(aWindow, false);
-    aWindow.close();
-  });
-
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 </script>
 
 </pre>
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
@@ -51,24 +51,18 @@ function testOnWindow(contentPage) {
     }, {capture: true, once: true});
   });
 }
 
 var alwaysbadids = [
   "badscript",
 ];
 
-function checkLoads(aWindow, aWhitelisted, tpEnabled) {
+function checkLoads(aWindow, aWhitelisted) {
   var win = aWindow.content;
-  if (!tpEnabled) {
-    is(win.document.getElementById("badscript").dataset.touched, "yes", "Should load tracking javascript");
-    is(win.document.blockedTrackingNodeCount, 0, "Should not identify any tracking elements");
-    return;
-  }
-
   is(win.document.getElementById("badscript").dataset.touched, "no", "Should not load tracking javascript");
   is(win.document.getElementById("goodscript").dataset.touched, aWhitelisted ? "yes" : "no", "Should load whitelisted tracking javascript");
 
   var badids = alwaysbadids.slice();
   if (!aWhitelisted) {
     badids.push("goodscript");
   }
   is(win.document.blockedTrackingNodeCount, badids.length, "Should identify all tracking elements");
@@ -110,40 +104,32 @@ SpecialPowers.pushPrefEnv(
   {"set": [["privacy.trackingprotection.enabled", true],
            ["channelclassifier.allowlist_example", true]]},
   test);
 
 async function test() {
   SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
   await UrlClassifierTestUtils.addTestTrackers();
 
-  // Load the test from a URL that's NOT on the whitelist with content blocking disabled
-  await SpecialPowers.setBoolPref("browser.contentblocking.enabled", false);
-  await testOnWindow(contentPage2).then(function(aWindow) {
-    checkLoads(aWindow, false, false);
+  // Load the test from a URL on the whitelist
+  await testOnWindow(contentPage1).then(function(aWindow) {
+    checkLoads(aWindow, true);
     aWindow.close();
   });
-  await SpecialPowers.clearUserPref("browser.contentblocking.enabled");
 
   // Load the test from a URL that's NOT on the whitelist
   await testOnWindow(contentPage2).then(function(aWindow) {
-    checkLoads(aWindow, false, true);
-    aWindow.close();
-  });
-
-  // Load the test from a URL on the whitelist
-  await testOnWindow(contentPage1).then(function(aWindow) {
-    checkLoads(aWindow, true, true);
+    checkLoads(aWindow, false);
     aWindow.close();
   });
 
   // Load the test from a URL on the whitelist but without the whitelist
   await SpecialPowers.setCharPref("urlclassifier.trackingWhitelistTable", "");
   await testOnWindow(contentPage1).then(function(aWindow) {
-    checkLoads(aWindow, false, true);
+    checkLoads(aWindow, false);
     aWindow.close();
   });
   await SpecialPowers.clearUserPref("urlclassifier.trackingWhitelistTable");
 
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();