Bug 1540856: Part 1 - Remove useless references to lightweightThemes preferences. r=aswan,dao

Differential Revision: https://phabricator.services.mozilla.com/D25677

--HG--
extra : rebase_source : d65a8b4e152342fd039cf35a410311f7ac664c9c
extra : histedit_source : c3fc70a285b39a6a8c09bac963211159573a5d09
This commit is contained in:
Kris Maglione 2019-04-01 15:22:20 -07:00
Родитель 30d5d1f356
Коммит 1c39319950
11 изменённых файлов: 0 добавлений и 65 удалений

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

@ -6,7 +6,6 @@
*/
const DEFAULT_THEME = "default-theme@mozilla.org";
const PREF_LWTHEME_USED_THEMES = "lightweightThemes.usedThemes";
const COMPACT_LIGHT_ID = "firefox-compact-light@mozilla.org";
const COMPACT_DARK_ID = "firefox-compact-dark@mozilla.org";
const {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm");

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

@ -2245,16 +2245,6 @@ BrowserGlue.prototype = {
let xulStore = Services.xulStore;
if (currentUIVersion < 51) {
// Switch to compact UI density if the user is using a formerly compact
// dark or light theme.
let currentTheme = Services.prefs.getCharPref("lightweightThemes.selectedThemeID", "");
if (currentTheme == "firefox-compact-dark@mozilla.org" ||
currentTheme == "firefox-compact-light@mozilla.org") {
Services.prefs.setIntPref("browser.uidensity", 1);
}
}
if (currentUIVersion < 52) {
// Keep old devtools log persistence behavior after splitting netmonitor and
// webconsole prefs (bug 1307881).
@ -2291,24 +2281,6 @@ BrowserGlue.prototype = {
}
}
if (currentUIVersion < 57) {
// Beginning Firefox 57, the theme accent color is shown as highlight
// on top of tabs. This didn't look too good with the "A Web Browser Renaissance"
// theme, so we're changing its accent color.
let lwthemePrefs = Services.prefs.getBranch("lightweightThemes.");
if (lwthemePrefs.prefHasUserValue("usedThemes")) {
try {
let usedThemes = lwthemePrefs.getStringPref("usedThemes");
usedThemes = JSON.parse(usedThemes);
let renaissanceTheme = usedThemes.find(theme => theme.id == "recommended-1");
if (renaissanceTheme) {
renaissanceTheme.accentcolor = "#834d29";
lwthemePrefs.setStringPref("usedThemes", JSON.stringify(usedThemes));
}
} catch (e) { /* Don't panic if this pref isn't what we expect it to be. */ }
}
}
if (currentUIVersion < 58) {
// With Firefox 57, we are doing a one time reset of the geo prefs due to bug 1413652
Services.prefs.clearUserPref("browser.search.countryCode");

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

@ -9,8 +9,6 @@ const LIGHT_THEME_ID = "firefox-compact-light@mozilla.org";
const DARK_THEME_ID = "firefox-compact-dark@mozilla.org";
add_task(async function() {
Services.prefs.clearUserPref("lightweightThemes.usedThemes");
await startCustomizing();
// Check restore defaults button is disabled.
ok(document.getElementById("customization-reset-button").disabled,
@ -132,7 +130,6 @@ add_task(async function() {
is(defaultTheme.isActive, true, "Current theme reset to default");
await endCustomizing();
Services.prefs.setCharPref("lightweightThemes.usedThemes", "[]");
await startCustomizing();
popupShownPromise = popupShown(popup);
EventUtils.synthesizeMouseAtCenter(themesButton, {});
@ -155,6 +152,4 @@ add_task(async function() {
add_task(async function asyncCleanup() {
await endCustomizing();
Services.prefs.clearUserPref("lightweightThemes.usedThemes");
});

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

@ -8,8 +8,6 @@ add_task(async function testCustomize() {
let getMoreURL = "about:blank#getMoreThemes";
// Reset the theme prefs to ensure they haven't been messed with.
Services.prefs.clearUserPref("lightweightThemes.recommendedThemes");
Services.prefs.clearUserPref("lightweightThemes.usedThemes");
await SpecialPowers.pushPrefEnv({set: [
["lightweightThemes.getMoreURL", getMoreURL],
]});
@ -54,10 +52,6 @@ add_task(async function testCustomize() {
["link", "customize", "getThemes"],
], "The events are recorded correctly");
// Reset the theme prefs to leave them in a clean state.
Services.prefs.clearUserPref("lightweightThemes.recommendedThemes");
Services.prefs.clearUserPref("lightweightThemes.usedThemes");
// Wait for customize mode to be re-entered now that the customize tab is
// active. This is needed for endCustomizing() to work properly.
await TestUtils.waitForCondition(

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

@ -198,7 +198,6 @@ pref("extensions.autoupdate.enabled", true);
pref("extensions.autoupdate.interval", 86400);
pref("extensions.update.enabled", true);
pref("extensions.update.interval", 86400);
pref("lightweightThemes.update.enabled", true);
pref("extensions.dss.enabled", false);
pref("extensions.ignoreMTimeChanges", false);
pref("extensions.logging.enabled", false);

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

@ -6548,11 +6548,6 @@ var Distribution = {
} catch (e) { /* ignore bad prefs and move on */ }
}
// Apply a lightweight theme if necessary
if (prefs && prefs["lightweightThemes.selectedThemeID"]) {
Services.obs.notifyObservers(null, "lightweight-theme-apply");
}
let localizedString = Cc["@mozilla.org/pref-localizedstring;1"].createInstance(Ci.nsIPrefLocalizedString);
let localizeablePrefs = aData["LocalizablePreferences"];
for (let key in localizeablePrefs) {

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

@ -44,7 +44,6 @@ class LightweightThemeConsumer {
constructor(aDocument) {
this._doc = aDocument;
Services.obs.addObserver(this, "lightweight-theme-styling-update");
Services.obs.addObserver(this, "lightweight-theme-apply");
this._update(LightweightThemeManager.currentThemeWithFallback);
}
@ -52,14 +51,11 @@ class LightweightThemeConsumer {
observe(aSubject, aTopic, aData) {
if (aTopic == "lightweight-theme-styling-update") {
this._update(aSubject.wrappedJSObject.theme);
} else if (aTopic == "lightweight-theme-apply") {
this._update(LightweightThemeManager.currentThemeWithFallback);
}
}
destroy() {
Services.obs.removeObserver(this, "lightweight-theme-styling-update");
Services.obs.removeObserver(this, "lightweight-theme-apply");
this._doc = null;
}

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

@ -66,9 +66,6 @@ user_pref("identity.fxaccounts.migrateToDevEdition", false);
// Avoid idle-daily notifications, to avoid expensive operations that may
// cause unexpected test timeouts.
user_pref("idle.lastDailyNotification", -1);
// Make tests run consistently on DevEdition (which has a lightweight theme
// selected by default).
user_pref("lightweightThemes.selectedThemeID", "");
user_pref("media.capturestream_hints.enabled", true);
user_pref("media.gmp-manager.url", "http://127.0.0.1/gmpmanager-dummy/update.xml");
// Don't block old libavcodec libraries when testing, because our test systems

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

@ -158,9 +158,6 @@ user_pref("javascript.options.showInConsole", true);
user_pref("layout.css.report_errors", true);
// Disable spammy layout warnings because they pollute test logs
user_pref("layout.spammy_warnings.enabled", false);
// Make tests run consistently on DevEdition (which has a lightweight theme
// selected by default).
user_pref("lightweightThemes.selectedThemeID", "");
// Disable all recommended Marionette preferences for Gecko tests.
// The prefs recommended by Marionette are typically geared towards
// consumer automation; not vendor testing.

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

@ -1479,11 +1479,6 @@ try {
.createInstance(Ci.nsIFile);
prefsFile.initWithPath(_PREFS_FILE);
_Services.prefs.readUserPrefsFromFile(prefsFile);
// Make tests run consistently on DevEdition (which has a lightweight theme
// selected by default).
_Services.prefs.deleteBranch("lightweightThemes.selectedThemeID");
_Services.prefs.deleteBranch("browser.devedition.theme.enabled");
}
} catch (e) {
do_throw(e);

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

@ -7,10 +7,6 @@
// The test extension uses an insecure update url.
Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
// This test requires lightweight themes update to be enabled even if the app
// doesn't support lightweight themes.
Services.prefs.setBoolPref("lightweightThemes.update.enabled", true);
const updateFile = "test_update.json";
const profileDir = gProfD.clone();