Bug 1385177 - Remove check for built-in self-support from shield recipe client r=mythmon

MozReview-Commit-ID: 3xxrSHFlV6i

--HG--
extra : rebase_source : d06dff2ce588ce8fdc45ce5fa2833f3d7f9d567c
This commit is contained in:
Robert Helmer 2017-07-27 22:24:05 -07:00
Родитель ca0a680558
Коммит 6403d4dfc8
2 изменённых файлов: 3 добавлений и 16 удалений

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

@ -42,7 +42,6 @@ const DEFAULT_PREFS = {
first_run: true,
};
const PREF_DEV_MODE = "extensions.shield-recipe-client.dev_mode";
const PREF_SELF_SUPPORT_ENABLED = "browser.selfsupport.enabled";
const PREF_LOGGING_LEVEL = PREF_BRANCH + "logging.level";
let log = null;
@ -64,16 +63,6 @@ this.ShieldRecipeClient = {
);
log = LogManager.getLogger("bootstrap");
// Disable self-support, since we replace its behavior.
// Self-support only checks its pref on start, so if we disable it, wait
// until next startup to run, unless the dev_mode preference is set.
if (Preferences.get(PREF_SELF_SUPPORT_ENABLED, true)) {
Preferences.set(PREF_SELF_SUPPORT_ENABLED, false);
if (!Preferences.get(PREF_DEV_MODE, false)) {
return;
}
}
// Initialize experiments first to avoid a race between initializing prefs
// and recipes rolling back pref changes when experiments end.
try {
@ -87,11 +76,6 @@ this.ShieldRecipeClient = {
shutdown(reason) {
CleanupManager.cleanup();
// Re-enable self-support if we're being disabled.
if (reason === REASONS.ADDON_DISABLE || reason === REASONS.ADDON_UNINSTALL) {
Services.prefs.setBoolPref(PREF_SELF_SUPPORT_ENABLED, true);
}
},
setDefaultPrefs() {

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

@ -116,6 +116,9 @@ add_task(async function testExperiments() {
add_task(async function isFirstRun() {
let environment = ClientEnvironment.getEnvironment();
// isFirstRun is set to false after the recipe client runs
ok(!environment.isFirstRun, "isFirstRun has a default value");
// isFirstRun is read from a preference
await SpecialPowers.pushPrefEnv({set: [["extensions.shield-recipe-client.first_run", true]]});
environment = ClientEnvironment.getEnvironment();