Bug 1356001 - Set MOZ_TEST_SKIP_UPDATE_STAGE in tests
"The existing mochitest chrome tests do this since tests that
stage have periodically timed out due to having to copy the
installation directory... especially on Linux." (from bug)
MozReview-Commit-ID: 7Gqqa9hLGVl
--- a/browser/base/content/test/appUpdate/head.js
+++ b/browser/base/content/test/appUpdate/head.js
@@ -23,16 +23,19 @@ const LOG_FUNCTION = info;
/* import-globals-from testConstants.js */
Services.scriptloader.loadSubScript(DATA_URI_SPEC + "testConstants.js", this);
/* import-globals-from ../../../../../toolkit/mozapps/update/tests/data/shared.js */
Services.scriptloader.loadSubScript(DATA_URI_SPEC + "shared.js", this);
var gURLData = URL_HOST + "/" + REL_PATH_DATA;
const URL_MANUAL_UPDATE = gURLData + "downloadPage.html";
+const gEnv = Cc["@mozilla.org/process/environment;1"].
+ getService(Components.interfaces.nsIEnvironment);
+
const NOTIFICATIONS = [
"update-available",
"update-manual",
"update-restart"
];
/**
* Delay for a very short period. Useful for moving the code after this
@@ -95,21 +98,23 @@ function setUpdateTimerPrefs() {
* A list of test steps to perform, specifying expected doorhangers
* and additional validation/cleanup callbacks.
* @return A promise which will resolve once all of the steps have been run
* and cleanup has been performed.
*/
function runUpdateTest(updateParams, checkAttempts, steps) {
return Task.spawn(function*() {
registerCleanupFunction(() => {
+ gEnv.set("MOZ_TEST_SKIP_UPDATE_STAGE", "");
gMenuButtonUpdateBadge.uninit();
gMenuButtonUpdateBadge.init();
cleanUpUpdates();
});
+ gEnv.set("MOZ_TEST_SKIP_UPDATE_STAGE", "1");
setUpdateTimerPrefs();
yield SpecialPowers.pushPrefEnv({
set: [
[PREF_APP_UPDATE_DOWNLOADPROMPTATTEMPTS, 0],
[PREF_APP_UPDATE_ENABLED, true],
[PREF_APP_UPDATE_IDLETIME, 0],
[PREF_APP_UPDATE_URL_MANUAL, URL_MANUAL_UPDATE],
[PREF_APP_UPDATE_LOG, DEBUG_AUS_TEST],
@@ -150,21 +155,23 @@ function runUpdateTest(updateParams, che
* A list of test steps to perform, specifying expected doorhangers
* and additional validation/cleanup callbacks.
* @return A promise which will resolve once all of the steps have been run
* and cleanup has been performed.
*/
function runUpdateProcessingTest(updates, steps) {
return Task.spawn(function*() {
registerCleanupFunction(() => {
+ gEnv.set("MOZ_TEST_SKIP_UPDATE_STAGE", "");
gMenuButtonUpdateBadge.reset();
cleanUpUpdates();
});
setUpdateTimerPrefs();
+ gEnv.set("MOZ_TEST_SKIP_UPDATE_STAGE", "1");
SpecialPowers.pushPrefEnv({
set: [
[PREF_APP_UPDATE_DOWNLOADPROMPTATTEMPTS, 0],
[PREF_APP_UPDATE_ENABLED, true],
[PREF_APP_UPDATE_IDLETIME, 0],
[PREF_APP_UPDATE_URL_MANUAL, URL_MANUAL_UPDATE],
[PREF_APP_UPDATE_LOG, DEBUG_AUS_TEST],
]});