Part 11 - Bug 951662 - fix updates patch dir in use after staging, make the helper sleep timeout consistent across tests, and use STATE_APPLIED instead of STATE_APPLIED_SVC on Windows for non service tests. r=bbondy
authorRobert Strong <robert.bugzilla@gmail.com>
Sun, 12 Jan 2014 13:47:29 -0800
changeset 163071 7c4ed21fed281cda422b6a1176e36d7fb0098f4f
parent 163070 399d1a584acfaa952c75a8afe02b50b59880cdc1
child 163072 3f4af26d05351fe23283e7e8c1552ad2fb39b16f
push id25979
push usercbook@mozilla.com
push dateMon, 13 Jan 2014 11:46:02 +0000
treeherdermozilla-central@ea6657f1d682 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy
bugs951662
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Part 11 - Bug 951662 - fix updates patch dir in use after staging, make the helper sleep timeout consistent across tests, and use STATE_APPLIED instead of STATE_APPLIED_SVC on Windows for non service tests. r=bbondy
toolkit/mozapps/update/nsUpdateService.js
toolkit/mozapps/update/tests/unit_aus_update/head_update.js
toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
toolkit/mozapps/update/tests/unit_base_updater/marAppInUseFallbackStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js
toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessPartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseFallbackStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseFallbackStageFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageSuccessComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageSuccessPartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessPartial_win.js
toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marAppInUseFallbackStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marAppInUseSuccessCompleteSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseFallbackStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseFallbackStageFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageSuccessCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageSuccessPartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFallbackStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFallbackStageFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseFallbackStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseFallbackStageFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageSuccessCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageSuccessPartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessPartialSvc_win.js
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -1218,85 +1218,70 @@ function cleanUpMozUpdaterDirs() {
  *        background.  If this is true, we move the update log file to the
  *        updated directory, so that it survives replacing the directories
  *        later on.
  */
 function cleanUpUpdatesDir(aBackgroundUpdate) {
   // Bail out if we don't have appropriate permissions
   try {
     var updateDir = getUpdatesDir();
-  }
-  catch (e) {
+  } catch (e) {
     return;
   }
 
-  var e = updateDir.directoryEntries;
-  while (e.hasMoreElements()) {
-    var f = e.getNext().QueryInterface(Ci.nsIFile);
-    // Preserve the last update log file for debugging purposes
-    if (f.leafName == FILE_UPDATE_LOG) {
-      var dir;
+  // Preserve the last update log file for debugging purposes.
+  let file = updateDir.clone();
+  file.append(FILE_UPDATE_LOG);
+  if (file.exists()) {
+    let dir;
+    if (aBackgroundUpdate && getUpdateDirNoCreate([]).equals(getAppBaseDir())) {
+      dir = getUpdatesDirInApplyToDir();
+    } else {
+      dir = updateDir.parent;
+    }
+    let logFile = dir.clone();
+    logFile.append(FILE_LAST_LOG);
+    if (logFile.exists()) {
       try {
-        // If we don't use the update root directory, the log files are written
-        // inside the application directory.  In that case, we want to write
-        // the log files to the updated directory in the case of background
-        // updates, so that they would be available when we replace that
-        // directory with the application directory later on.
-        if (aBackgroundUpdate && getUpdateDirNoCreate([]).equals(getAppBaseDir())) {
-          dir = getUpdatesDirInApplyToDir();
-        } else {
-          dir = f.parent.parent;
-        }
-        var logFile = dir.clone();
-        logFile.append(FILE_LAST_LOG);
-        if (logFile.exists()) {
-          try {
-            logFile.moveTo(dir, FILE_BACKUP_LOG);
-          }
-          catch (e) {
-            LOG("cleanUpUpdatesDir - failed to rename file " + logFile.path +
-                " to " + FILE_BACKUP_LOG);
-          }
-        }
-        f.moveTo(dir, FILE_LAST_LOG);
-        if (aBackgroundUpdate) {
-          // We're not going to delete any files, so we can just
-          // bail out of the loop right now.
-          break;
-        } else {
-          continue;
+        logFile.moveTo(dir, FILE_BACKUP_LOG);
+      } catch (e) {
+        LOG("cleanUpUpdatesDir - failed to rename file " + logFile.path +
+            " to " + FILE_BACKUP_LOG);
+      }
+    }
+
+    try {
+      file.moveTo(dir, FILE_LAST_LOG);
+    } catch (e) {
+      LOG("cleanUpUpdatesDir - failed to rename file " + file.path +
+          " to " + FILE_LAST_LOG);
+    }
+  }
+
+  if (!aBackgroundUpdate) {
+    let e = updateDir.directoryEntries;
+    while (e.hasMoreElements()) {
+      let f = e.getNext().QueryInterface(Ci.nsIFile);
+#ifdef MOZ_WIDGET_GONK
+      if (f.leafName == FILE_UPDATE_LINK) {
+        let linkedFile = getFileFromUpdateLink(updateDir);
+        if (linkedFile && linkedFile.exists()) {
+          linkedFile.remove(false);
         }
       }
-      catch (e) {
-        LOG("cleanUpUpdatesDir - failed to move file " + f.path + " to " +
-            dir.path + " and rename it to " + FILE_LAST_LOG);
+#endif
+
+      // Now, recursively remove this file.  The recursive removal is needed for
+      // Mac OSX because this directory will contain a copy of updater.app,
+      // which is itself a directory.
+      try {
+        f.remove(true);
+      } catch (e) {
+        LOG("cleanUpUpdatesDir - failed to remove file " + f.path);
       }
-    } else if (aBackgroundUpdate) {
-      // Don't delete any files when an update has been staged, as
-      // we need to keep them around in case we would have to fall
-      // back to applying the update on application restart.
-      continue;
-    }
-#ifdef MOZ_WIDGET_GONK
-    if (f.leafName == FILE_UPDATE_LINK) {
-      let linkedFile = getFileFromUpdateLink(updateDir);
-      if (linkedFile && linkedFile.exists()) {
-        linkedFile.remove(false);
-      }
-    }
-#endif
-
-    // Now, recursively remove this file.  The recursive removal is really
-    // only needed on Mac OSX because this directory will contain a copy of
-    // updater.app, which is itself a directory.
-    try {
-      f.remove(true);
-    }
-    catch (e) {
-      LOG("cleanUpUpdatesDir - failed to remove file " + f.path);
     }
   }
   releaseSDCardMountLock();
 }
 
 /**
  * Clean up updates list and the updates directory.
  */
--- a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
@@ -117,22 +117,25 @@ const MAC_MAX_TIME_DIFFERENCE = 60000;
 const TEST_HELPER_TIMEOUT = 100;
 
 // Time to wait for a check in the test before continuing the test
 const TEST_CHECK_TIMEOUT = 100;
 
 // How many of TEST_CHECK_TIMEOUT to wait before we abort the test.
 const MAX_TIMEOUT_RUNS = 2000;
 
+// Time in seconds the helper application should sleep.the helper's input and output files
+const HELPER_SLEEP_TIMEOUT = 180;
+
 // Maximum number of milliseconds the process that is launched can run before
 // the test will try to kill it.
 const APP_TIMER_TIMEOUT = 120000;
 
 #ifdef XP_WIN
-const PIPE_TO_NULL = "1> nul 2>&1";
+const PIPE_TO_NULL = ">nul";
 #else
 const PIPE_TO_NULL = "> /dev/null 2>&1";
 #endif
 
 // This default value will be overridden when using the http server.
 var gURLData = URL_HOST + "/";
 
 var gTestID;
@@ -356,22 +359,16 @@ var DEBUG_TEST_LOG = false;
 // Set to false to keep the log file from the failed parallel test run.
 var gDeleteLogFile = true;
 var gRealDump;
 var gTestLogText = "";
 var gPassed;
 
 #include ../shared.js
 
-#ifdef MOZ_MAINTENANCE_SERVICE
-const STATE_APPLIED_PLATFORM = STATE_APPLIED_SVC;
-#else
-const STATE_APPLIED_PLATFORM = STATE_APPLIED;
-#endif
-
 // This makes it possible to run most tests on xulrunner where the update
 // channel default preference is not set.
 if (MOZ_APP_NAME == "xulrunner") {
   try {
     gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
   } catch (e) {
     setUpdateChannel("test_channel");
   }
@@ -417,46 +414,47 @@ function setupTestCommon() {
   gGREDirOrig = getGREDir();
   gAppDirOrig = getAppBaseDir();
 
   let applyDir = getApplyDirFile(null, true).parent;
   if (IS_MACOSX) {
     applyDir = applyDir.parent;
   }
 
-  // Try to remove the directory used to apply updates. Since the test hasn't
-  // ran yet and the directory shouldn't exist finished this is non-fatal for
-  // the test.
+  // Try to remove the directory used to apply updates and the updates directory
+  // on platforms other than Windows. Since the test hasn't ran yet and the
+  // directory shouldn't exist finished this is non-fatal for the test.
   if (applyDir.exists()) {
     logTestInfo("attempting to remove directory. Path: " + applyDir.path);
     try {
       removeDirRecursive(applyDir);
     } catch (e) {
       logTestInfo("non-fatal error removing directory. Path: " +
                   applyDir.path + ", Exception: " + e);
     }
   }
 
   // adjustGeneralPaths registers a cleanup function that calls end_test when
   // it is defined as a function.
   adjustGeneralPaths();
 
-  removeUpdateDirsAndFiles();
-
-  // Try to remove the directory used to apply updates. Since the test hasn't
-  // ran yet and the directory shouldn't exist finished this is non-fatal for
-  // the test.
-  let updatesDir = getMockUpdRootD();
-  if (updatesDir.exists())  {
-    logTestInfo("attempting to remove directory. Path: " + updatesDir.path);
-    try {
-      removeDirRecursive(updatesDir);
-    } catch (e) {
-      logTestInfo("non-fatal error removing directory. Path: " +
-                  updatesDir.path + ", Exception: " + e);
+  // Remove the updates directory on Windows which is located outside of the
+  // application directory after the call to adjustGeneralPaths has set it up.
+  // Since the test hasn't ran yet and the directory shouldn't exist finished
+  // this is non-fatal for the test.
+  if (IS_WIN) {
+    let updatesDir = getMockUpdRootD();
+    if (updatesDir.exists())  {
+      logTestInfo("attempting to remove directory. Path: " + updatesDir.path);
+      try {
+        removeDirRecursive(updatesDir);
+      } catch (e) {
+        logTestInfo("non-fatal error removing directory. Path: " +
+                    updatesDir.path + ", Exception: " + e);
+      }
     }
   }
 
   logTestInfo("finish - general test setup");
 }
 
 /**
  * Nulls out the most commonly used global vars used by tests to prevent leaks
@@ -519,18 +517,16 @@ function cleanupTestCommon() {
                AUS_Ci.nsIWindowsRegKey.ACCESS_ALL);
       if (key.hasValue(appDir.path)) {
         key.removeValue(appDir.path);
       }
     } catch (e) {
     }
   }
 
-  removeUpdateDirsAndFiles();
-
   // The updates directory is located outside of the application directory on
   // Windows so it also needs to be removed.
   if (IS_WIN) {
     let updatesDir = getMockUpdRootD();
     // Try to remove the directory used to apply updates. Since the test has
     // already finished this is non-fatal for the test.
     if (updatesDir.exists()) {
       logTestInfo("attempting to remove directory. Path: " + updatesDir.path);
@@ -1535,18 +1531,17 @@ function runUpdateUsingService(aInitialS
   do_check_eq(readStatusState(), aInitialStatus);
 
   writeVersionFile(DEFAULT_UPDATE_VERSION);
 
   gServiceLaunchedCallbackArgs = [
     "-no-remote",
     "-process-updates",
     "-dump-args",
-    appArgsLogPath,
-    PIPE_TO_NULL
+    appArgsLogPath
   ];
 
   if (gSwitchApp) {
     // We want to set the env vars again
     gShouldResetEnv = undefined;
   }
 
   setEnvironment();
@@ -1698,18 +1693,18 @@ function waitForHelperFinished() {
     return;
   }
   // Give the lock file process time to unlock the file before deleting the
   // input and output files.
   waitForHelperFinishFileUnlock();
 }
 
 /**
- * Helper function that waits until the helper's input and output directories
- * are no longer in use before calling checkUpdate.
+ * Helper function that waits until the helper's input and output files are no
+ * longer in use before calling checkUpdate.
  */
 function waitForHelperFinishFileUnlock() {
   try {
     let output = getApplyDirFile("a/b/output", true);
     if (output.exists()) {
       output.remove(false);
     }
     let input = getApplyDirFile("a/b/input", true);
@@ -2590,17 +2585,17 @@ function getProcessArgs(aExtraArgs) {
     scriptContents += appBinPath + " -no-remote -process-updates " +
                       aExtraArgs.join(" ") + " " + PIPE_TO_NULL;
     writeFile(launchScript, scriptContents);
     logTestInfo("created " + launchScript.path + " containing:\n" +
                 scriptContents);
     args = [launchScript.path];
   } else {
     args = ["/D", "/Q", "/C", appBinPath, "-no-remote", "-process-updates"].
-           concat(aExtraArgs).concat(["1> nul 2>&1"]);
+           concat(aExtraArgs).concat([PIPE_TO_NULL]);
   }
   return args;
 }
 
 /**
  * Gets a file path for the application to dump its arguments into.  This is used
  * to verify that a callback application is launched.
  *
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
@@ -18,17 +18,17 @@ function run_test() {
   if (MOZ_APP_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
   setupTestCommon();
 
   if (IS_WIN) {
-    Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
+    Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, false);
   }
 
   let channel = Services.prefs.getCharPref(PREF_APP_UPDATE_CHANNEL);
   let patches = getLocalPatchString(null, null, null, null, null, "true",
                                     STATE_PENDING);
   let updates = getLocalUpdateString(patches, null, null, null, null, null,
                                      null, null, null, null, null, null,
                                      null, "true", channel);
@@ -77,33 +77,33 @@ function customLaunchAppToApplyUpdate() 
 }
 
 /**
  * Checks if the update has finished being staged.
  */
 function checkUpdateApplied() {
   gTimeoutRuns++;
   // Don't proceed until the active update's state is applied.
-  if (gUpdateManager.activeUpdate.state != STATE_APPLIED_PLATFORM) {
+  if (gUpdateManager.activeUpdate.state != STATE_APPLIED) {
     if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
       do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for update to be " +
                "applied, current state is: " +
                gUpdateManager.activeUpdate.state);
     } else {
       do_timeout(TEST_CHECK_TIMEOUT, checkUpdateApplied);
     }
     return;
   }
 
   // Don't proceed until the update's status state is applied.
   let state = readStatusState();
-  if (state != STATE_APPLIED_PLATFORM) {
+  if (state != STATE_APPLIED) {
     if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
       do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the update " +
-               "status state to equal " + STATE_APPLIED_PLATFORM + ", " +
+               "status state to equal " + STATE_APPLIED + ", " +
                "current status state: " + state);
     } else {
       do_timeout(TEST_CHECK_TIMEOUT, checkUpdateApplied);
     }
     return;
   }
 
   // Don't proceed until the last update log has been created.
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
@@ -16,17 +16,17 @@ function run_test() {
   if (MOZ_APP_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
   setupTestCommon();
 
   if (IS_WIN) {
-    Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
+    Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, false);
   }
 
   let channel = Services.prefs.getCharPref(PREF_APP_UPDATE_CHANNEL);
   let patches = getLocalPatchString(null, null, null, null, null, "true",
                                     STATE_PENDING);
   let updates = getLocalUpdateString(patches, null, null, null, null, null,
                                      null, null, null, null, null, null,
                                      null, "true", channel);
@@ -52,33 +52,33 @@ function setupAppFilesFinished() {
 }
 
 /**
  * Checks if the update has finished being staged.
  */
 function checkUpdateApplied() {
   gTimeoutRuns++;
   // Don't proceed until the update state is applied.
-  if (gUpdateManager.activeUpdate.state != STATE_APPLIED_PLATFORM) {
+  if (gUpdateManager.activeUpdate.state != STATE_APPLIED) {
     if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
       do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for update to be " +
                "applied, current state is: " +
                gUpdateManager.activeUpdate.state);
     } else {
       do_timeout(TEST_CHECK_TIMEOUT, checkUpdateApplied);
     }
     return;
   }
 
   // Don't proceed until the update status state is applied.
   let state = readStatusState();
-  if (state != STATE_APPLIED_PLATFORM) {
+  if (state != STATE_APPLIED) {
     if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
       do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the update " +
-               "status state to equal " + STATE_APPLIED_PLATFORM + ", " +
+               "status state to equal " + STATE_APPLIED + ", " +
                "current status state: " + state);
     } else {
       do_timeout(TEST_CHECK_TIMEOUT, checkUpdateApplied);
     }
     return;
   }
 
   // Don't proceed until the last update log has been created.
@@ -258,17 +258,17 @@ function checkUpdateFinished() {
   do_check_eq(readFileBytes(file), "UpdateTestAddFile\n");
 
   file = updateTestDir.clone();
   file.append("removed-files");
   logTestInfo("testing " + file.path + " should exist");
   do_check_true(file.exists());
   do_check_eq(readFileBytes(file), "update_test/UpdateTestRemoveFile\n");
 
-  log = getUpdatesDir();
+  let log = getUpdatesDir();
   log.append("0");
   log.append(FILE_UPDATE_LOG);
   if (IS_WIN) {
     // On Windows, this log file is written to the AppData directory, and will
     // therefore exist.
     logTestInfo("testing " + log.path + " should exist");
     do_check_true(log.exists());
   } else {
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseFallbackStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseFallbackStageFailureComplete_win.js
@@ -183,17 +183,18 @@ ADDITIONAL_TEST_DIRS = [
 
 function run_test() {
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch the callback helper application so it is in use during the update.
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
@@ -183,17 +183,18 @@ ADDITIONAL_TEST_DIRS = [
 
 function run_test() {
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch the callback helper application so it is in use during the update.
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js
@@ -240,17 +240,18 @@ function run_test() {
     let yesterday = now - (1000 * 60 * 60 * 24);
     let applyToDir = getApplyDirFile(null, true);
     applyToDir.lastModifiedTime = yesterday;
   }
 
   // Launch the callback helper application so it is in use during the update
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
   callbackApp.permissions = PERMS_DIRECTORY;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js
@@ -229,17 +229,18 @@ ADDITIONAL_TEST_DIRS = [
 
 function run_test() {
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch the callback helper application so it is in use during the update.
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
   callbackApp.permissions = PERMS_DIRECTORY;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailureComplete_win.js
@@ -190,17 +190,18 @@ ADDITIONAL_TEST_DIRS = [
 function run_test() {
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailurePartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailurePartial_win.js
@@ -192,17 +192,18 @@ ADDITIONAL_TEST_DIRS = [
 function run_test() {
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessComplete_win.js
@@ -190,17 +190,18 @@ ADDITIONAL_TEST_DIRS = [
 function run_test() {
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessPartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessPartial_win.js
@@ -192,17 +192,18 @@ ADDITIONAL_TEST_DIRS = [
 function run_test() {
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js
@@ -189,17 +189,18 @@ ADDITIONAL_TEST_DIRS = [
 
 function run_test() {
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js
@@ -191,17 +191,18 @@ ADDITIONAL_TEST_DIRS = [
 
 function run_test() {
   setupTestCommon();
   setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js
@@ -190,17 +190,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js
@@ -191,17 +191,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailureComplete_win.js
@@ -191,17 +191,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailurePartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailurePartial_win.js
@@ -192,17 +192,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailureComplete_win.js
@@ -191,17 +191,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailurePartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailurePartial_win.js
@@ -192,17 +192,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseFallbackStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseFallbackStageFailureComplete_win.js
@@ -200,17 +200,18 @@ function run_test() {
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[4].relPathDir +
                                     TEST_DIRS[4].subDirs[0]);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[4].subDirFiles[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseFallbackStageFailurePartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseFallbackStageFailurePartial_win.js
@@ -200,17 +200,18 @@ function run_test() {
   // replace it.
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[2].relPathDir);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[2].files[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageSuccessComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageSuccessComplete_win.js
@@ -200,17 +200,18 @@ function run_test() {
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[4].relPathDir +
                                     TEST_DIRS[4].subDirs[0]);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[4].subDirFiles[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageSuccessPartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageSuccessPartial_win.js
@@ -200,17 +200,18 @@ function run_test() {
   // replace it.
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[2].relPathDir);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[2].files[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessComplete_win.js
@@ -199,17 +199,18 @@ function run_test() {
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[4].relPathDir +
                                     TEST_DIRS[4].subDirs[0]);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[4].subDirFiles[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessPartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessPartial_win.js
@@ -199,17 +199,18 @@ function run_test() {
   // replace it.
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[2].relPathDir);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[2].files[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
@@ -81,33 +81,33 @@ function customLaunchAppToApplyUpdate() 
 }
 
 /**
  * Checks if the update has finished being staged.
  */
 function checkUpdateApplied() {
   gTimeoutRuns++;
   // Don't proceed until the active update's state is applied.
-  if (gUpdateManager.activeUpdate.state != STATE_APPLIED_PLATFORM) {
+  if (gUpdateManager.activeUpdate.state != STATE_APPLIED_SVC) {
     if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
       do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for update to be " +
-               "applied, current state is: " +
+               STATE_APPLIED_SVC + ", current state is: " +
                gUpdateManager.activeUpdate.state);
     } else {
       do_timeout(TEST_CHECK_TIMEOUT, checkUpdateApplied);
     }
     return;
   }
 
   // Don't proceed until the update's status state is applied.
   let state = readStatusState();
-  if (state != STATE_APPLIED_PLATFORM) {
+  if (state != STATE_APPLIED_SVC) {
     if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
       do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the update " +
-               "status state to equal " + STATE_APPLIED_PLATFORM + ", " +
+               "status state to equal " + STATE_APPLIED_SVC + ", " +
                "current status state: " + state);
     } else {
       do_timeout(TEST_CHECK_TIMEOUT, checkUpdateApplied);
     }
     return;
   }
 
   // Don't proceed until the last update log has been created.
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
@@ -56,33 +56,33 @@ function setupAppFilesFinished() {
 }
 
 /**
  * Checks if the update has finished being staged.
  */
 function checkUpdateApplied() {
   gTimeoutRuns++;
   // Don't proceed until the update state is applied.
-  if (gUpdateManager.activeUpdate.state != STATE_APPLIED_PLATFORM) {
+  if (gUpdateManager.activeUpdate.state != STATE_APPLIED_SVC) {
     if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
       do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for update to be " +
-               "applied, current state is: " +
+               STATE_APPLIED_SVC + ", current state is: " +
                gUpdateManager.activeUpdate.state);
     } else {
       do_timeout(TEST_CHECK_TIMEOUT, checkUpdateApplied);
     }
     return;
   }
 
   // Don't proceed until the update status state is applied.
   let state = readStatusState();
-  if (state != STATE_APPLIED_PLATFORM) {
+  if (state != STATE_APPLIED_SVC) {
     if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
       do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the update " +
-               "status state to equal " + STATE_APPLIED_PLATFORM + ", " +
+               "status state to equal " + STATE_APPLIED_SVC + ", " +
                "current status state: " + state);
     } else {
       do_timeout(TEST_CHECK_TIMEOUT, checkUpdateApplied);
     }
     return;
   }
 
   // Don't proceed until the last update log has been created.
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseFallbackStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseFallbackStageFailureCompleteSvc_win.js
@@ -187,17 +187,18 @@ function run_test() {
   }
 
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch the callback helper application so it is in use during the update.
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
@@ -187,17 +187,18 @@ function run_test() {
   }
 
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch the callback helper application so it is in use during the update.
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseSuccessCompleteSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseSuccessCompleteSvc.js
@@ -233,17 +233,18 @@ function run_test() {
   }
 
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch the callback helper application so it is in use during the update.
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
   callbackApp.permissions = PERMS_DIRECTORY;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseFallbackStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseFallbackStageFailureCompleteSvc_win.js
@@ -194,17 +194,18 @@ function run_test() {
 
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseFallbackStageFailurePartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseFallbackStageFailurePartialSvc_win.js
@@ -196,17 +196,18 @@ function run_test() {
 
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageSuccessCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageSuccessCompleteSvc_win.js
@@ -194,17 +194,18 @@ function run_test() {
 
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageSuccessPartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageSuccessPartialSvc_win.js
@@ -196,17 +196,18 @@ function run_test() {
 
   gStageUpdate = true;
   setupTestCommon();
   setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js
@@ -193,17 +193,18 @@ function run_test() {
   }
 
   setupTestCommon();
   setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js
@@ -195,17 +195,18 @@ function run_test() {
   }
 
   setupTestCommon();
   setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update.
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js
@@ -194,17 +194,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js
@@ -195,17 +195,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFallbackStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFallbackStageFailureCompleteSvc_win.js
@@ -195,17 +195,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFallbackStageFailurePartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFallbackStageFailurePartialSvc_win.js
@@ -196,17 +196,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js
@@ -195,17 +195,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js
@@ -196,17 +196,18 @@ function run_test() {
   let helperDestDir = getApplyDirFile("a/b/");
   helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
   helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT, lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
   lockFileProcess.init(helperBin);
   lockFileProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseFallbackStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseFallbackStageFailureCompleteSvc_win.js
@@ -204,17 +204,18 @@ function run_test() {
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[4].relPathDir +
                                     TEST_DIRS[4].subDirs[0]);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[4].subDirFiles[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseFallbackStageFailurePartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseFallbackStageFailurePartialSvc_win.js
@@ -204,17 +204,18 @@ function run_test() {
   // replace it.
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[2].relPathDir);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[2].files[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageSuccessCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageSuccessCompleteSvc_win.js
@@ -204,17 +204,18 @@ function run_test() {
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[4].relPathDir +
                                     TEST_DIRS[4].subDirs[0]);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[4].subDirFiles[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageSuccessPartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageSuccessPartialSvc_win.js
@@ -204,17 +204,18 @@ function run_test() {
   // replace it.
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[2].relPathDir);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[2].files[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessCompleteSvc_win.js
@@ -203,17 +203,18 @@ function run_test() {
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[4].relPathDir +
                                     TEST_DIRS[4].subDirs[0]);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[4].subDirFiles[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }
 
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessPartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessPartialSvc_win.js
@@ -203,17 +203,18 @@ function run_test() {
   // replace it.
   fileInUseBin.remove(false);
 
   let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let fileInUseDir = getApplyDirFile(TEST_DIRS[2].relPathDir);
   helperBin.copyTo(fileInUseDir, TEST_DIRS[2].files[0]);
 
   // Launch an existing file so it is in use during the update.
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
+  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
+              HELPER_SLEEP_TIMEOUT];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
   fileInUseProcess.run(false, args, args.length);
 
   setupAppFilesAsync();
 }