From 6c5ebe669194326154d2eb3e8b25f96f50dce63f Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Thu, 19 Feb 2015 05:43:19 -0800 Subject: [PATCH] Bug 1134334 - Intermittent run-by-dir test_0900_deprecatedUpdateFormat_minor.xul | Checking currentPage.pageid equals checking in pageshow - got downloading, expected checking. r=spohl --- toolkit/mozapps/update/tests/chrome/utils.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/toolkit/mozapps/update/tests/chrome/utils.js b/toolkit/mozapps/update/tests/chrome/utils.js index ba83ea6e3a5..3530b713e4d 100644 --- a/toolkit/mozapps/update/tests/chrome/utils.js +++ b/toolkit/mozapps/update/tests/chrome/utils.js @@ -150,6 +150,10 @@ const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul"; const ADDON_ID_SUFFIX = "@appupdatetest.mozilla.org"; const ADDON_PREP_DIR = "appupdateprep"; + +const PREF_APP_UPDATE_INTERVAL = "app.update.interval"; +const PREF_APP_UPDATE_LASTUPDATETIME = "app.update.lastUpdateTime.background-update-timer"; + // 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"; @@ -877,6 +881,14 @@ function setupPrefs() { Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, true); } + // Prevent nsIUpdateTimerManager from notifying nsIApplicationUpdateService + // to check for updates by setting the app update last update time to the + // current time minus one minute in seconds and the interval time to 12 hours + // in seconds. + let now = Math.round(Date.now() / 1000) - 60; + Services.prefs.setIntPref(PREF_APP_UPDATE_LASTUPDATETIME, now); + Services.prefs.setIntPref(PREF_APP_UPDATE_INTERVAL, 43200); + if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE)) { gAppUpdateURL = Services.prefs.getCharPref(PREF_APP_UPDATE_URL_OVERRIDE); }