Bug 1083073 - Fix update tests when app.update.silent is true by default. r=bbondy
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 15 Oct 2014 01:24:00 +0200
changeset 210604 074a7010a1add5fd17295a7059f46d298c3d168c
parent 210603 2316f7e0b19616243793dae108ac0d6d4dc6c62d
child 210605 757c194494a264422dba528ebca41f32ec790e1e
child 210768 659522f48d699c372d373eed8bd89e53823d6dee
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbbondy
bugs1083073
milestone36.0a1
Bug 1083073 - Fix update tests when app.update.silent is true by default. r=bbondy
toolkit/mozapps/update/tests/chrome/utils.js
--- 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;
   }