Part 2: Bug 1354530 - Disable offline group in Preferences in Nightly because Storage Management v1 spec is done, r=jaws

MozReview-Commit-ID: A4xbomLFYlQ

--HG--
extra : rebase_source : 9b5088f65c86ea6eb78b1c020cabed8922555234
This commit is contained in:
Fischer.json 2017-04-07 21:21:32 +08:00
Родитель a08651e908
Коммит c39e57fe94
3 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -685,7 +685,11 @@ pref("browser.preferences.search", false);
// (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);

Просмотреть файл

@ -57,6 +57,6 @@ add_task(function* () {
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");
});

Просмотреть файл

@ -21,6 +21,16 @@ function checkElements(expectedPane) {
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) {