diff --git a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js index 92e28fd09d1..226ea86c988 100644 --- a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js +++ b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js @@ -369,6 +369,8 @@ if (MOZ_APP_NAME == "xulrunner") { * Helper function for setting up the test environment. */ function setupTestCommon() { + logTestInfo("start - general test setup"); + do_test_pending(); if (gTestID) { @@ -421,6 +423,8 @@ function setupTestCommon() { updatesDir.path + ", Exception: " + e); } } + + logTestInfo("finish - general test setup"); } /** diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js index 469d811802d..d7b13455d7c 100644 --- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js +++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js @@ -228,6 +228,22 @@ function checkUpdateFinished() { return; } + let updater = getUpdatesPatchDir(); + updater.append(FILE_UPDATER_BIN); + if (updater.exists()) { + if (gTimeoutRuns > MAX_TIMEOUT_RUNS) { + do_throw("Exceeded while waiting for updater binary to no longer be in " + + "use"); + } else { + try { + updater.remove(false); + } catch (e) { + do_timeout(TEST_CHECK_TIMEOUT, checkUpdateFinished); + return; + } + } + } + let updateTestDir = getUpdateTestDir(); let file = updateTestDir.clone(); diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js index e1c16e5cba0..a6954042c79 100644 --- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js +++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js @@ -100,11 +100,16 @@ function checkUpdateFinished() { let updater = getUpdatesPatchDir(); updater.append(FILE_UPDATER_BIN); if (updater.exists()) { - try { - updater.remove(false); - } catch (e) { - do_timeout(TEST_CHECK_TIMEOUT, checkUpdateFinished); - return; + if (gTimeoutRuns > MAX_TIMEOUT_RUNS) { + do_throw("Exceeded while waiting for updater binary to no longer be in " + + "use"); + } else { + try { + updater.remove(false); + } catch (e) { + do_timeout(TEST_CHECK_TIMEOUT, checkUpdateFinished); + return; + } } } diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js index bb55778e464..c9bb7386250 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js @@ -232,6 +232,22 @@ function checkUpdateFinished() { return; } + let updater = getUpdatesPatchDir(); + updater.append(FILE_UPDATER_BIN); + if (updater.exists()) { + if (gTimeoutRuns > MAX_TIMEOUT_RUNS) { + do_throw("Exceeded while waiting for updater binary to no longer be in " + + "use"); + } else { + try { + updater.remove(false); + } catch (e) { + do_timeout(TEST_CHECK_TIMEOUT, checkUpdateFinished); + return; + } + } + } + let updateTestDir = getUpdateTestDir(); let file = updateTestDir.clone(); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js index dd96307e629..566b755ec74 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js @@ -104,11 +104,16 @@ function checkUpdateFinished() { let updater = getUpdatesPatchDir(); updater.append(FILE_UPDATER_BIN); if (updater.exists()) { - try { - updater.remove(false); - } catch (e) { - do_timeout(TEST_CHECK_TIMEOUT, checkUpdateFinished); - return; + if (gTimeoutRuns > MAX_TIMEOUT_RUNS) { + do_throw("Exceeded while waiting for updater binary to no longer be in " + + "use"); + } else { + try { + updater.remove(false); + } catch (e) { + do_timeout(TEST_CHECK_TIMEOUT, checkUpdateFinished); + return; + } } } diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp index 8e9e422f047..779415b4edd 100644 --- a/toolkit/mozapps/update/updater/updater.cpp +++ b/toolkit/mozapps/update/updater/updater.cpp @@ -3139,10 +3139,12 @@ int NS_main(int argc, NS_tchar **argv) } #endif /* XP_MACOSX */ - LaunchCallbackApp(argv[4], - argc - callbackIndex, - argv + callbackIndex, - sUsingService); + if (getenv("MOZ_PROCESS_UPDATES") == nullptr) { + LaunchCallbackApp(argv[4], + argc - callbackIndex, + argv + callbackIndex, + sUsingService); + } } return gSucceeded ? 0 : 1;