Bug 1083073 - Fix update tests when app.update.silent is true by default. r=bbondy
--- a/toolkit/mozapps/update/tests/chrome/utils.js
+++ b/toolkit/mozapps/update/tests/chrome/utils.js
@@ -149,16 +149,17 @@ const URL_HTTPS_UPDATE_XML = "https://ex
const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul";
const ADDON_ID_SUFFIX = "@appupdatetest.mozilla.org";
const ADDON_PREP_DIR = "appupdateprep";
// Preference for storing add-ons that are disabled by the tests to prevent them
// from interefering with the tests.
const PREF_DISABLEDADDONS = "app.update.test.disabledAddons";
const PREF_EM_HOTFIX_ID = "extensions.hotfix.id";
+const PREF_EM_SILENT = "app.update.silent";
const TEST_ADDONS = [ "appdisabled_1", "appdisabled_2",
"compatible_1", "compatible_2",
"noupdate_1", "noupdate_2",
"updatecompatibility_1", "updatecompatibility_2",
"updateversion_1", "updateversion_2",
"userdisabled_1", "userdisabled_2", "hotfix" ];
var gURLData = URL_HOST + "/" + REL_PATH_DATA + "/";
@@ -906,16 +907,17 @@ function setupPrefs() {
let extUpdateUrl = URL_HTTP_UPDATE_XML + "?addonID=%ITEM_ID%" +
"&platformVersion=" + getNewerPlatformVersion();
Services.prefs.setCharPref(PREF_EXTENSIONS_UPDATE_URL, extUpdateUrl);
Services.prefs.setIntPref(PREF_APP_UPDATE_IDLETIME, 0);
Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 0);
Services.prefs.setBoolPref(PREF_EXTENSIONS_STRICT_COMPAT, true);
Services.prefs.setCharPref(PREF_EM_HOTFIX_ID, "hotfix" + ADDON_ID_SUFFIX);
+ Services.prefs.setBoolPref(PREF_EM_SILENT, false);
}
/**
* Restores files that were backed up for the tests and general file cleanup.
*/
function resetFiles() {
// Restore the backed up updater-settings.ini if it exists.
let baseAppDir = getAppBaseDir();
@@ -1066,16 +1068,20 @@ function resetPrefs() {
if (Services.prefs.prefHasUserValue(PREF_EXTENSIONS_STRICT_COMPAT)) {
Services.prefs.clearUserPref(PREF_EXTENSIONS_STRICT_COMPAT);
}
if (Services.prefs.prefHasUserValue(PREF_EM_HOTFIX_ID)) {
Services.prefs.clearUserPref(PREF_EM_HOTFIX_ID);
}
+
+ if (Services.prefs.prefHasUserValue(PREF_EM_SILENT)) {
+ Services.prefs.clearUserPref(PREF_EM_SILENT);
+ }
}
function setupTimer(aTestTimeout) {
gTestTimeout = aTestTimeout;
if (gTimeoutTimer) {
gTimeoutTimer.cancel();
gTimeoutTimer = null;
}