Part 2: Bug 1354530 - Disable offline group in Preferences in Nightly because Storage Management v1 spec is done, r=jaws draft
authorFischer.json <fischer.json@gmail.com>
Fri, 07 Apr 2017 21:21:32 +0800
changeset 561282 34888d66a31af32132fef7cc648be76342105335
parent 561281 66fcc06bf14ba895933083aaf9226df1937b1655
child 623930 2ac61f78ea89af7d36c98623e1901c93522357b6
push id53683
push userbmo:fliu@mozilla.com
push dateWed, 12 Apr 2017 11:53:17 +0000
reviewersjaws
bugs1354530
milestone55.0a1
Part 2: Bug 1354530 - Disable offline group in Preferences in Nightly because Storage Management v1 spec is done, r=jaws MozReview-Commit-ID: A4xbomLFYlQ
browser/app/profile/firefox.js
browser/base/content/test/general/browser_storagePressure_notification.js
browser/components/preferences/in-content/tests/browser_bug731866.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -680,17 +680,21 @@ pref("browser.preferences.instantApply",
 
 // Toggling Search bar on and off in about:preferences
 pref("browser.preferences.search", false);
 
 // Once the Storage Management is completed.
 // (The Storage Management-related prefs are browser.storageManager.* )
 // The Offline(Appcache) Group section in about:preferences will be hidden.
 // And the task to clear appcache will be done by Storage Management.
+#if defined(NIGHTLY_BUILD)
+pref("browser.preferences.offlineGroup.enabled", false);
+#else
 pref("browser.preferences.offlineGroup.enabled", true);
+#endif
 
 pref("browser.download.show_plugins_in_list", true);
 pref("browser.download.hide_plugins_without_extensions", true);
 
 // Backspace and Shift+Backspace behavior
 // 0 goes Back/Forward
 // 1 act like PgUp/PgDown
 // 2 and other values, nothing
--- a/browser/base/content/test/general/browser_storagePressure_notification.js
+++ b/browser/base/content/test/general/browser_storagePressure_notification.js
@@ -52,11 +52,11 @@ add_task(function* () {
   let notification = notificationbox.getNotificationWithValue("storage-pressure-notification");
   ok(notification instanceof XULElement, "Should display storage pressure notification");
 
   let prefBtn = notification.getElementsByTagName("button")[1];
   let aboutPrefPromise = privacyAboutPrefPromise();
   prefBtn.doCommand();
   yield aboutPrefPromise;
   let prefDoc = gBrowser.selectedBrowser.contentDocument;
-  let offlineGroup = prefDoc.getElementById("offlineGroup");
-  is_element_visible(offlineGroup, "Should open the Network tab in about:preferences#privacy");
+  let siteDataGroup = prefDoc.getElementById("siteDataGroup");
+  is_element_visible(siteDataGroup, "Should open the Network tab in about:preferences#privacy");
 });
--- a/browser/components/preferences/in-content/tests/browser_bug731866.js
+++ b/browser/components/preferences/in-content/tests/browser_bug731866.js
@@ -16,16 +16,26 @@ function checkElements(expectedPane) {
   for (let element of gElements) {
     // keyset and preferences elements fail is_element_visible checks because they are never visible.
     // special-case the drmGroup item because its visibility depends on pref + OS version
     if (element.nodeName == "keyset" ||
         element.nodeName == "preferences" ||
         element.id === "drmGroup") {
       continue;
     }
+
+    // The siteDataGroup in the Storage Management project will replace the offlineGroup eventually,
+    // so during the transition period, we have to check the pref to see if the offlineGroup
+    // should be hidden always. See the bug 1354530 for the details.
+    if (element.id == "offlineGroup" &&
+        !SpecialPowers.getBoolPref("browser.preferences.offlineGroup.enabled")) {
+      is_element_hidden(element, "Disabled offlineGroup should be hidden");
+      continue;
+    }
+
     let attributeValue = element.getAttribute("data-category");
     let suffix = " (id=" + element.id + ")";
     if (attributeValue == "pane" + expectedPane) {
       is_element_visible(element, expectedPane + " elements should be visible" + suffix);
     } else {
       is_element_hidden(element, "Elements not in " + expectedPane + " should be hidden" + suffix);
     }
   }