Backed out changeset 0aaf1e3ab6ea (bug 1385177) for failing browser-chrome's browser_sanitizeDialog.js and browser_clientAuth_connection.js. r=backout

This commit is contained in:
Sebastian Hengst 2017-07-29 10:12:58 +02:00
Родитель 4bbc40dee1
Коммит e69b5c12ac
3 изменённых файлов: 17 добавлений и 4 удалений

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

@ -42,6 +42,7 @@ 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;
@ -63,6 +64,16 @@ 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 {
@ -76,6 +87,11 @@ 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,9 +116,6 @@ 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();

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

@ -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://%(server)s/selfsupport-dummy/");
user_pref("extensions.shield-recipe-client.api_url", "https://example.com/selfsupport-dummy/");
user_pref("media.eme.enabled", true);