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

MozReview-Commit-ID: 52e6FrUdJF4

--HG--
extra : rebase_source : 33c733b10b4bbeb7f595881d009d9752ae992af8
This commit is contained in:
Robert Helmer 2017-07-28 13:58:35 -07:00
Родитель 460b84a6db
Коммит 763890559c
3 изменённых файлов: 4 добавлений и 17 удалений

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

@ -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 initially set to true
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();

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

@ -321,7 +321,7 @@ user_pref("browser.search.countryCode", "US");
user_pref("browser.search.geoSpecificDefaults", false);
// Make sure Shield doesn't hit the network.
user_pref("extensions.shield-recipe-client.api_url", "https://example.com/selfsupport-dummy/");
user_pref("extensions.shield-recipe-client.api_url", "");
user_pref("media.eme.enabled", true);