Bug 1428306 - Remove browser.storageManager.enabled pref r=baku,johannh

MozReview-Commit-ID: GodyYuGxVD

--HG--
extra : rebase_source : 0ba78e764ea2c77ecaafcd35a502940ea1a37ac2
This commit is contained in:
Michael Kohler 2018-04-09 20:46:45 +02:00
Родитель 691e26b1b6
Коммит 4c381de5f6
17 изменённых файлов: 27 добавлений и 115 удалений

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

@ -499,8 +499,7 @@ const gStoragePressureObserver = {
_lastNotificationTime: -1,
observe(subject, topic, data) {
if (topic != "QuotaManager::StoragePressure" ||
!Services.prefs.getBoolPref("browser.storageManager.enabled")) {
if (topic != "QuotaManager::StoragePressure") {
return;
}

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

@ -23,7 +23,6 @@ function openAboutPrefPromise() {
// Test only displaying notification once within the given interval
add_task(async function() {
const TEST_NOTIFICATION_INTERVAL_MS = 2000;
await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.enabled", true]]});
await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.pressureNotification.minIntervalMS", TEST_NOTIFICATION_INTERVAL_MS]]});
// Commenting this to see if we really need it
// await SpecialPowers.pushPrefEnv({set: [["privacy.reduceTimerPrecision", false]]});
@ -47,7 +46,6 @@ add_task(async function() {
// Test guiding user to the about:preferences when usage exceeds the given threshold
add_task(async function() {
await SpecialPowers.pushPrefEnv({ set: [["browser.storageManager.enabled", true]] });
await SpecialPowers.pushPrefEnv({ set: [["browser.storageManager.pressureNotification.minIntervalMS", 0]] });
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "https://example.com");
@ -74,7 +72,6 @@ add_task(async function() {
// Test not displaying the 2nd notification if one is already being displayed
add_task(async function() {
const TEST_NOTIFICATION_INTERVAL_MS = 0;
await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.enabled", true]]});
await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.pressureNotification.minIntervalMS", TEST_NOTIFICATION_INTERVAL_MS]]});
await notifyStoragePressure();

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

@ -2767,9 +2767,7 @@ const ContentPermissionIntegration = {
return new PermissionUI.DesktopNotificationPermissionPrompt(request);
}
case "persistent-storage": {
if (Services.prefs.getBoolPref("browser.storageManager.enabled")) {
return new PermissionUI.PersistentStoragePermissionPrompt(request);
}
return new PermissionUI.PersistentStoragePermissionPrompt(request);
}
case "midi": {
return new PermissionUI.MIDIPermissionPrompt(request);

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

@ -337,25 +337,21 @@ var gPrivacyPane = {
}
}
if (Services.prefs.getBoolPref("browser.storageManager.enabled")) {
Services.obs.addObserver(this, "sitedatamanager:sites-updated");
Services.obs.addObserver(this, "sitedatamanager:updating-sites");
let unload = () => {
window.removeEventListener("unload", unload);
Services.obs.removeObserver(this, "sitedatamanager:sites-updated");
Services.obs.removeObserver(this, "sitedatamanager:updating-sites");
};
window.addEventListener("unload", unload);
SiteDataManager.updateSites();
setEventListener("clearSiteDataButton", "command",
gPrivacyPane.clearSiteData);
setEventListener("siteDataSettings", "command",
gPrivacyPane.showSiteDataSettings);
let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
document.getElementById("siteDataLearnMoreLink").setAttribute("href", url);
let siteDataGroup = document.getElementById("siteDataGroup");
siteDataGroup.removeAttribute("data-hidden-from-search");
}
Services.obs.addObserver(this, "sitedatamanager:sites-updated");
Services.obs.addObserver(this, "sitedatamanager:updating-sites");
let unload = () => {
window.removeEventListener("unload", unload);
Services.obs.removeObserver(this, "sitedatamanager:sites-updated");
Services.obs.removeObserver(this, "sitedatamanager:updating-sites");
};
window.addEventListener("unload", unload);
SiteDataManager.updateSites();
setEventListener("clearSiteDataButton", "command",
gPrivacyPane.clearSiteData);
setEventListener("siteDataSettings", "command",
gPrivacyPane.showSiteDataSettings);
let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
document.getElementById("siteDataLearnMoreLink").setAttribute("href", url);
let notificationInfoURL =
Services.urlFormatter.formatURLPref("app.support.baseURL") + "push";

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

@ -160,7 +160,7 @@
</groupbox>
<!-- Site Data -->
<groupbox id="siteDataGroup" hidden="true" data-category="panePrivacy" data-hidden-from-search="true">
<groupbox id="siteDataGroup" data-category="panePrivacy">
<caption><label data-l10n-id="sitedata-header"/></caption>
<hbox data-subcategory="sitedata" align="baseline">

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

@ -4,7 +4,6 @@
ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const storageManagerDisabled = !SpecialPowers.getBoolPref("browser.storageManager.enabled");
const browserContainersGroupDisabled = !SpecialPowers.getBoolPref("privacy.userContext.ui.enabled");
function test() {
@ -22,14 +21,7 @@ function checkElements(expectedPane) {
element.id === "drmGroup") {
continue;
}
// The siteDataGroup in the Storage Management project is currently only pref-on on Nightly for testing purpose.
// During the test and the transition period, we have to check the pref to see if the siteDataGroup
// should be hidden always. This would be a bit bothersome, same as the offlineGroup as below.
// However, this checking is necessary to make sure we don't leak the siteDataGroup into beta/release build
if (element.id == "siteDataGroup" && storageManagerDisabled) {
is_element_hidden(element, "Disabled siteDataGroup should be hidden");
continue;
}
// The browserContainersGroup is still only pref-on on Nightly
if (element.id == "browserContainersGroup" && browserContainersGroupDisabled) {
is_element_hidden(element, "Disabled browserContainersGroup should be hidden");

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

@ -5,8 +5,7 @@
// Enabling Searching functionatily. Will display search bar form this testcase forward.
add_task(async function() {
await SpecialPowers.pushPrefEnv({"set": [
["browser.preferences.search", true],
["browser.storageManager.enabled", true]
["browser.preferences.search", true]
]});
});

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

@ -7,8 +7,7 @@ requestLongerTimeout(2);
// Enabling Searching functionatily. Will display search bar form this testcase forward.
add_task(async function() {
await SpecialPowers.pushPrefEnv({"set": [
["browser.preferences.search", true],
["browser.storageManager.enabled", true]
["browser.preferences.search", true]
]});
});

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

@ -212,49 +212,6 @@ add_task(async function exiting_search_reverts_to_general_pane() {
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
/**
* Test for "Site Data" case, verifying elements with data-hidden-from-search = true
* are hidden in search result.
*/
add_task(async function verify_hidden_from_search_elements_dont_show_up() {
await SpecialPowers.pushPrefEnv({ "set": [["browser.storageManager.enabled", false]] });
await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true });
let generalPane = gBrowser.contentDocument.getElementById("generalCategory");
is_element_hidden(generalPane, "Should not be in general");
// Performs search
let searchInput = gBrowser.contentDocument.getElementById("searchInput");
is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"),
"Search input should be focused when visiting preferences");
let query = "site data";
let searchCompletedPromise = BrowserTestUtils.waitForEvent(
gBrowser.contentWindow, "PreferencesSearchCompleted", evt => evt.detail == query);
EventUtils.sendString(query);
await searchCompletedPromise;
let mainPrefTag = gBrowser.contentDocument.getElementById("mainPrefPane");
let child = mainPrefTag.querySelector("#siteDataGroup");
is_element_hidden(child, "Should be hidden in search results");
// Takes search off
searchCompletedPromise = BrowserTestUtils.waitForEvent(
gBrowser.contentWindow, "PreferencesSearchCompleted", evt => evt.detail == "");
let count = query.length;
while (count--) {
EventUtils.sendKey("BACK_SPACE");
}
await searchCompletedPromise;
// Checks if back to normal
is_element_visible(generalPane, "Should be in generalPane");
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
/**
* Test for if we go to another tab after searching
*/

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

@ -4,7 +4,6 @@
* Test for "command" event on search input (when user clicks the x button)
*/
add_task(async function() {
await SpecialPowers.pushPrefEnv({"set": [["browser.storageManager.enabled", false]]});
await openPreferencesViaOpenPreferencesAPI("privacy", {leaveOpen: true});
let generalPane = gBrowser.contentDocument.getElementById("generalCategory");

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

@ -684,12 +684,6 @@ var gPermissionObject = {
}
};
// Delete this entry while being pre-off
// or the persistent-storage permission would appear in Page info's Permission section
if (!Services.prefs.getBoolPref("browser.storageManager.enabled")) {
delete gPermissionObject["persistent-storage"];
}
if (!Services.prefs.getBoolPref("dom.webmidi.enabled")) {
// ESLint gets angry about array versus dot notation here, but some permission
// names use hyphens. Disabling rule for line to keep things consistent.

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

@ -6,19 +6,13 @@
ChromeUtils.import("resource:///modules/SitePermissions.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
const STORAGE_MANAGER_ENABLED = Services.prefs.getBoolPref("browser.storageManager.enabled");
const RESIST_FINGERPRINTING_ENABLED = Services.prefs.getBoolPref("privacy.resistFingerprinting");
const MIDI_ENABLED = Services.prefs.getBoolPref("dom.webmidi.enabled");
add_task(async function testPermissionsListing() {
let expectedPermissions = ["camera", "cookie", "desktop-notification", "focus-tab-by-prompt",
"geo", "image", "install", "microphone", "plugin:flash", "popup", "screen", "shortcuts"];
if (STORAGE_MANAGER_ENABLED) {
// The persistent-storage permission is still only pref-on on Nightly
// so we add it only when it's pref-on.
// Should remove this checking and add it as default after it is fully pref-on.
expectedPermissions.push("persistent-storage");
}
"geo", "image", "install", "microphone", "plugin:flash", "popup", "screen", "shortcuts",
"persistent-storage"];
if (RESIST_FINGERPRINTING_ENABLED) {
// Canvas permission should be hidden unless privacy.resistFingerprinting
// is true.
@ -113,13 +107,7 @@ add_task(async function testExactHostMatch() {
let subUri = Services.io.newURI("https://test1.example.com");
let exactHostMatched = ["desktop-notification", "focus-tab-by-prompt", "camera",
"microphone", "screen", "geo"];
if (STORAGE_MANAGER_ENABLED) {
// The persistent-storage permission is still only pref-on on Nightly
// so we add it only when it's pref-on.
// Should remove this checking and add it as default after it is fully pref-on.
exactHostMatched.push("persistent-storage");
}
"microphone", "screen", "geo", "persistent-storage"];
if (RESIST_FINGERPRINTING_ENABLED) {
// Canvas permission should be hidden unless privacy.resistFingerprinting
// is true.

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

@ -16,7 +16,6 @@ let lastTab = null;
var PermissionPrompts = {
init(libDir) {
Services.prefs.setBoolPref("browser.storageManager.enabled", true);
Services.prefs.setBoolPref("media.navigator.permission.fake", true);
Services.prefs.setBoolPref("extensions.install.requireBuiltInCerts", false);
Services.prefs.setBoolPref("signon.rememberSignons", true);

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

@ -13,8 +13,7 @@
SpecialPowers.pushPrefEnv({
"set": [["dom.storageManager.enabled", true],
["dom.storageManager.prompt.testing", false],
["dom.storageManager.prompt.testing.allow", false],
["browser.storageManager.enabled", true]]
["dom.storageManager.prompt.testing.allow", false]]
}, continueToNextStep);
yield undefined;

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

@ -5776,9 +5776,7 @@ pref("dom.storageManager.enabled", false);
pref("dom.storageManager.prompt.testing", false);
pref("dom.storageManager.prompt.testing.allow", false);
// Enable the Storage management in about:preferences and persistent-storage permission request
// To enable the DOM implementation, turn on "dom.storageManager.enabled"
pref("browser.storageManager.enabled", true);
pref("browser.storageManager.pressureNotification.minIntervalMS", 1200000);
pref("browser.storageManager.pressureNotification.usageThresholdGB", 5);

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

@ -1,2 +1,2 @@
[storagemanager-persist.https.html]
prefs: [browser.storageManager.enabled:true, dom.storageManager.prompt.testing:true]
prefs: [dom.storageManager.prompt.testing:true]

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

@ -20,8 +20,6 @@ add_task(async function test_background_storagePersist() {
await SpecialPowers.pushPrefEnv({
"set": [
["dom.storageManager.enabled", true],
// Enable the storageManager permission prompt.
["browser.storageManager.enabled", true],
["dom.storageManager.prompt.testing", false],
["dom.storageManager.prompt.testing.allow", false],
],