Test code - Bug 1342742 - check that the app update patch dir, install dir, and working dir paths are valid. r=mhowell, a=tests
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 03 May 2017 16:31:49 -0700
changeset 396135 bbcddab3288afe64402e5093cf7786fe152bb4e7
parent 396134 f7d1810de3816ea87d58c3828640f9939862ee2e
child 396136 bbc43c6d7d15ba3d609c461b10d879e854d846b0
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell, tests
bugs1342742
milestone54.0
Test code - Bug 1342742 - check that the app update patch dir, install dir, and working dir paths are valid. r=mhowell, a=tests
toolkit/mozapps/update/tests/TestAUSHelper.cpp
toolkit/mozapps/update/tests/data/sharedUpdateXML.js
toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js
toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js
toolkit/mozapps/update/tests/unit_base_updater/marWrongApplyToDirFailure_win.js
toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini
toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js
toolkit/mozapps/update/tests/unit_service_updater/xpcshell.ini
--- a/toolkit/mozapps/update/tests/TestAUSHelper.cpp
+++ b/toolkit/mozapps/update/tests/TestAUSHelper.cpp
@@ -332,16 +332,36 @@ int NS_main(int argc, NS_tchar **argv)
     LPCWSTR application = argv[2];
     return (ERROR_NOT_FOUND == IsProcessRunning(application)) ? 0 : 1;
 #else
     // Not implemented on non-Windows platforms
     return 1;
 #endif
   }
 
+  if (!NS_tstrcmp(argv[1], NS_T("launch-service"))) {
+#ifdef XP_WIN
+    DWORD ret = LaunchServiceSoftwareUpdateCommand(argc - 2, (LPCWSTR *)argv + 2);
+    if (ret != ERROR_SUCCESS) {
+      // 192 is used to avoid reusing a possible return value from the call to
+      // WaitForServiceStop
+      return 0x000000C0;
+    }
+    // Wait a maximum of 120 seconds.
+    DWORD lastState = WaitForServiceStop(SVC_NAME, 120);
+    if (SERVICE_STOPPED == lastState) {
+      return 0;
+    }
+    return lastState;
+#else
+    // Not implemented on non-Windows platforms
+    return 1;
+#endif
+  }
+
   if (NS_tchdir(argv[1]) != 0) {
     return 1;
   }
 
   // File in use test helper section
   if (!NS_tstrcmp(argv[4], NS_T("-s"))) {
     NS_tchar *cwd = NS_tgetcwd(nullptr, 0);
     NS_tchar inFilePath[MAXPATHLEN];
--- a/toolkit/mozapps/update/tests/data/sharedUpdateXML.js
+++ b/toolkit/mozapps/update/tests/data/sharedUpdateXML.js
@@ -32,43 +32,64 @@ const STATE_PENDING         = "pending";
 const STATE_PENDING_SVC     = "pending-service";
 const STATE_APPLYING        = "applying";
 const STATE_APPLIED         = "applied";
 const STATE_APPLIED_SVC     = "applied-service";
 const STATE_SUCCEEDED       = "succeeded";
 const STATE_DOWNLOAD_FAILED = "download-failed";
 const STATE_FAILED          = "failed";
 
-const LOADSOURCE_ERROR_WRONG_SIZE      = 2;
-const CRC_ERROR                        = 4;
-const READ_ERROR                       = 6;
-const WRITE_ERROR                      = 7;
-const MAR_CHANNEL_MISMATCH_ERROR       = 22;
-const VERSION_DOWNGRADE_ERROR          = 23;
-const INVALID_APPLYTO_DIR_STAGED_ERROR = 72;
-const INVALID_APPLYTO_DIR_ERROR        = 74;
+const LOADSOURCE_ERROR_WRONG_SIZE              = 2;
+const CRC_ERROR                                = 4;
+const READ_ERROR                               = 6;
+const WRITE_ERROR                              = 7;
+const MAR_CHANNEL_MISMATCH_ERROR               = 22;
+const VERSION_DOWNGRADE_ERROR                  = 23;
+const SERVICE_COULD_NOT_COPY_UPDATER           = 49;
+const SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR = 52;
+const SERVICE_INVALID_APPLYTO_DIR_ERROR        = 54;
+const SERVICE_INVALID_INSTALL_DIR_PATH_ERROR   = 55;
+const SERVICE_INVALID_WORKING_DIR_PATH_ERROR   = 56;
+const INVALID_APPLYTO_DIR_STAGED_ERROR         = 72;
+const INVALID_APPLYTO_DIR_ERROR                = 74;
+const INVALID_INSTALL_DIR_PATH_ERROR           = 75;
+const INVALID_WORKING_DIR_PATH_ERROR           = 76;
 
 const STATE_FAILED_DELIMETER = ": ";
 
 const STATE_FAILED_LOADSOURCE_ERROR_WRONG_SIZE =
   STATE_FAILED + STATE_FAILED_DELIMETER + LOADSOURCE_ERROR_WRONG_SIZE;
 const STATE_FAILED_CRC_ERROR =
   STATE_FAILED + STATE_FAILED_DELIMETER + CRC_ERROR;
 const STATE_FAILED_READ_ERROR =
   STATE_FAILED + STATE_FAILED_DELIMETER + READ_ERROR;
 const STATE_FAILED_WRITE_ERROR =
   STATE_FAILED + STATE_FAILED_DELIMETER + WRITE_ERROR;
 const STATE_FAILED_MAR_CHANNEL_MISMATCH_ERROR =
   STATE_FAILED + STATE_FAILED_DELIMETER + MAR_CHANNEL_MISMATCH_ERROR;
 const STATE_FAILED_VERSION_DOWNGRADE_ERROR =
   STATE_FAILED + STATE_FAILED_DELIMETER + VERSION_DOWNGRADE_ERROR;
+const STATE_FAILED_SERVICE_COULD_NOT_COPY_UPDATER =
+  STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_COULD_NOT_COPY_UPDATER
+const STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR =
+  STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR;
+const STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR =
+  STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_APPLYTO_DIR_ERROR;
+const STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR =
+  STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_INSTALL_DIR_PATH_ERROR;
+const STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR =
+  STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_WORKING_DIR_PATH_ERROR;
 const STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR =
   STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_APPLYTO_DIR_STAGED_ERROR;
 const STATE_FAILED_INVALID_APPLYTO_DIR_ERROR =
   STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_APPLYTO_DIR_ERROR;
+const STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR =
+  STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_INSTALL_DIR_PATH_ERROR;
+const STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR =
+  STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_WORKING_DIR_PATH_ERROR;
 
 /**
  * Constructs a string representing a remote update xml file.
  *
  * @param  aUpdates
  *         The string representing the update elements.
  * @return The string representing a remote update xml file.
  */
--- a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
+++ b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
@@ -152,21 +152,16 @@ var gStatusResult;
 var gProcess;
 var gAppTimer;
 var gHandle;
 
 var gGREDirOrig;
 var gGREBinDirOrig;
 var gAppDirOrig;
 
-var gApplyToDirOverride;
-
-var gServiceLaunchedCallbackLog = null;
-var gServiceLaunchedCallbackArgs = null;
-
 // Variables are used instead of contants so tests can override these values if
 // necessary.
 var gCallbackBinFile = "callback_app" + BIN_SUFFIX;
 var gCallbackArgs = ["./", "callback.log", "Test Arg 2", "Test Arg 3"];
 var gPostUpdateBinFile = "postup_app" + BIN_SUFFIX;
 var gSvcOriginalLogContents;
 var gUseTestAppDir = true;
 // Some update staging failures can remove the update. This allows tests to
@@ -829,16 +824,19 @@ function setupTestCommon() {
   if (IS_WIN) {
     Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED,
                                IS_SERVICE_TEST ? true : false);
   }
 
   // adjustGeneralPaths registers a cleanup function that calls end_test when
   // it is defined as a function.
   adjustGeneralPaths();
+  // Logged once here instead of in the mock directory provider to lessen test
+  // log spam.
+  debugDump("Updates Directory (UpdRootD) Path: " + getMockUpdRootD().path);
 
   // This prevents a warning about not being able to find the greprefs.js file
   // from being logged.
   let grePrefsFile = getGREDir();
   if (!grePrefsFile.exists()) {
     grePrefsFile.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
   }
   grePrefsFile.append("greprefs.js");
@@ -1127,28 +1125,16 @@ function getAppVersion() {
             MSG_SHOULD_EXIST + getMsgPath(iniFile.path));
   let iniParser = Cc["@mozilla.org/xpcom/ini-parser-factory;1"].
                   getService(Ci.nsIINIParserFactory).
                   createINIParser(iniFile);
   return iniParser.getString("App", "Version");
 }
 
 /**
- * Override the apply-to directory parameter to be passed to the updater.
- * This ought to cause the updater to fail when using any value that isn't the
- * default, automatically computed one.
- *
- * @param dir
- *        Complete string to use as the apply-to directory parameter.
- */
-function overrideApplyToDir(dir) {
-  gApplyToDirOverride = dir;
-}
-
-/**
  * Helper function for getting the relative path to the directory where the
  * application binary is located (e.g. <test_file_leafname>/dir.app/).
  *
  * Note: The dir.app subdirectory under <test_file_leafname> is needed for
  *       platforms other than Mac OS X so the tests can run in parallel due to
  *       update staging creating a lock file named moz_update_in_progress.lock in
  *       the parent directory of the installation directory.
  *
@@ -1449,17 +1435,16 @@ function getMockUpdRootDWin() {
       relPathUpdates += MOZ_APP_BASENAME;
     }
     relPathUpdates += "\\" + MOZ_APP_NAME;
   }
 
   let updatesDir = Cc["@mozilla.org/file/local;1"].
                    createInstance(Ci.nsILocalFile);
   updatesDir.initWithPath(localAppDataDir.path + "\\" + relPathUpdates);
-  debugDump("returning UpdRootD Path: " + updatesDir.path);
   return updatesDir;
 }
 
 XPCOMUtils.defineLazyGetter(this, "gUpdatesRootDir", function test_gURD() {
   if (!IS_MACOSX) {
     do_throw("Mac OS X only function called by a different platform!");
   }
 
@@ -1489,17 +1474,16 @@ function getMockUpdRootDMac() {
                parent.parent.parent;
   let appDirPath = appDir.path;
   appDirPath = appDirPath.substr(0, appDirPath.length - 4);
 
   let pathUpdates = gUpdatesRootDir.path + appDirPath;
   let updatesDir = Cc["@mozilla.org/file/local;1"].
                    createInstance(Ci.nsILocalFile);
   updatesDir.initWithPath(pathUpdates);
-  debugDump("returning UpdRootD Path: " + updatesDir.path);
   return updatesDir;
 }
 
 /**
  * Creates an update in progress lock file in the specified directory on
  * Windows.
  *
  * @param   aDir
@@ -1667,64 +1651,84 @@ function readServiceLogFile() {
  *          If true the update should switch the application with an updated
  *          staged application and if false the update should be applied to the
  *          installed application.
  * @param   aExpectedExitValue
  *          The expected exit value from the updater binary for non-service
  *          tests.
  * @param   aCheckSvcLog
  *          Whether the service log should be checked for service tests.
+ * @param   aPatchDirPath (optional)
+ *          When specified the patch directory path to use for invalid argument
+ *          tests otherwise the normal path will be used.
+ * @param   aInstallDirPath (optional)
+ *          When specified the install directory path to use for invalid
+ *          argument tests otherwise the normal path will be used.
+ * @param   aApplyToDirPath (optional)
+ *          When specified the apply to / working directory path to use for
+ *          invalid argument tests otherwise the normal path will be used.
  */
-function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue,
-                   aCheckSvcLog) {
+function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue, aCheckSvcLog,
+                   aPatchDirPath, aInstallDirPath, aApplyToDirPath) {
+  let isInvalidArgTest = !!aPatchDirPath || !!aInstallDirPath || !!aApplyToDirPath;
+
   let svcOriginalLog;
   if (IS_SERVICE_TEST) {
     copyFileToTestAppDir(FILE_MAINTENANCE_SERVICE_BIN, false);
     copyFileToTestAppDir(FILE_MAINTENANCE_SERVICE_INSTALLER_BIN, false);
     if (aCheckSvcLog) {
       svcOriginalLog = readServiceLogFile();
     }
   }
 
   // Copy the updater binary to the directory where it will apply updates.
   let updateBin = copyTestUpdaterForRunUsingUpdater();
   Assert.ok(updateBin.exists(),
             MSG_SHOULD_EXIST + getMsgPath(updateBin.path));
 
-  let updatesDirPath = getUpdatesPatchDir().path;
-  let applyToDirPath = getApplyDirFile(null, true).path;
-  let stageDirPath = getStageDirFile(null, true).path;
+  let updatesDirPath = aPatchDirPath || getUpdatesPatchDir().path;
+  let installDirPath = aInstallDirPath || getApplyDirFile(null, true).path;
+  let applyToDirPath = aApplyToDirPath || getApplyDirFile(null, true).path;
+  let stageDirPath = aApplyToDirPath || getStageDirFile(null, true).path;
 
   let callbackApp = getApplyDirFile(DIR_RESOURCES + gCallbackBinFile);
   callbackApp.permissions = PERMS_DIRECTORY;
 
   setAppBundleModTime();
 
-  let args = [updatesDirPath, applyToDirPath];
+  let args = [updatesDirPath, installDirPath];
   if (aSwitchApp) {
-    args[2] = gApplyToDirOverride || stageDirPath;
+    args[2] = stageDirPath;
     args[3] = "0/replace";
   } else {
-    args[2] = gApplyToDirOverride || applyToDirPath;
+    args[2] = applyToDirPath;
     args[3] = "0";
   }
-  args = args.concat([callbackApp.parent.path, callbackApp.path]);
-  args = args.concat(gCallbackArgs);
-  debugDump("running the updater: " + updateBin.path + " " + args.join(" "));
-
-  if (aSwitchApp) {
+
+  let launchBin = IS_SERVICE_TEST && isInvalidArgTest ? callbackApp : updateBin;
+
+  if (!isInvalidArgTest) {
+    args = args.concat([callbackApp.parent.path, callbackApp.path]);
+    args = args.concat(gCallbackArgs);
+  } else if (IS_SERVICE_TEST) {
+    args = ["launch-service", updateBin.path].concat(args);
+  }
+
+  debugDump("launching the program: " + launchBin.path + " " + args.join(" "));
+
+  if (aSwitchApp && !isInvalidArgTest) {
     // We want to set the env vars again
     gShouldResetEnv = undefined;
   }
 
   setEnvironment();
 
   let process = Cc["@mozilla.org/process/util;1"].
                 createInstance(Ci.nsIProcess);
-  process.init(updateBin);
+  process.init(launchBin);
   process.run(true, args, args.length);
 
   resetEnvironment();
 
   let status = readStatusFile();
   if ((!IS_SERVICE_TEST && process.exitValue != aExpectedExitValue) ||
       status != aExpectedStatus) {
     if (process.exitValue != aExpectedExitValue) {
@@ -1745,19 +1749,21 @@ function runUpdate(aExpectedStatus, aSwi
   Assert.equal(status, aExpectedStatus,
                "the update status" + MSG_SHOULD_EQUAL);
 
   if (IS_SERVICE_TEST && aCheckSvcLog) {
     let contents = readServiceLogFile();
     Assert.notEqual(contents, svcOriginalLog,
                     "the contents of the maintenanceservice.log should not " +
                     "be the same as the original contents");
-    Assert.notEqual(contents.indexOf(LOG_SVC_SUCCESSFUL_LAUNCH), -1,
-                    "the contents of the maintenanceservice.log should " +
-                    "contain the successful launch string");
+    if (!isInvalidArgTest) {
+      Assert.notEqual(contents.indexOf(LOG_SVC_SUCCESSFUL_LAUNCH), -1,
+                      "the contents of the maintenanceservice.log should " +
+                      "contain the successful launch string");
+    }
   }
 
   do_execute_soon(runUpdateFinished);
 }
 
 /**
  * Launches the helper binary synchronously with the specified arguments for
  * updater tests.
@@ -2570,18 +2576,22 @@ function waitForHelperExit() {
  * Helper function for updater binary tests that creates the files and
  * directories used by the test.
  *
  * @param   aMarFile
  *          The mar file for the update test.
  * @param   aPostUpdateAsync
  *          When null the updater.ini is not created otherwise this parameter
  *          is passed to createUpdaterINI.
+ * @param   aPostUpdateExeRelPathPrefix
+ *          When aPostUpdateAsync null this value is ignored otherwise it is
+ *          passed to createUpdaterINI.
  */
-function setupUpdaterTest(aMarFile, aPostUpdateAsync) {
+function setupUpdaterTest(aMarFile, aPostUpdateAsync,
+                          aPostUpdateExeRelPathPrefix = "") {
   let updatesPatchDir = getUpdatesPatchDir();
   if (!updatesPatchDir.exists()) {
     updatesPatchDir.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
   }
   // Copy the mar that will be applied
   let mar = getTestDirFile(aMarFile);
   mar.copyToFollowingLinks(updatesPatchDir, FILE_UPDATE_MAR);
 
@@ -2656,17 +2666,17 @@ function setupUpdaterTest(aMarFile, aPos
         }
       });
     }
   });
 
   setupActiveUpdate();
 
   if (aPostUpdateAsync !== null) {
-    createUpdaterINI(aPostUpdateAsync);
+    createUpdaterINI(aPostUpdateAsync, aPostUpdateExeRelPathPrefix);
   }
 
   setupAppFilesAsync();
 }
 
 /**
  * Helper function for updater binary tests that creates the update-settings.ini
  * file.
@@ -2679,39 +2689,48 @@ function createUpdateSettingsINI() {
 /**
  * Helper function for updater binary tests that creates the updater.ini
  * file.
  *
  * @param   aIsExeAsync
  *          True or undefined if the post update process should be async. If
  *          undefined ExeAsync will not be added to the updater.ini file in
  *          order to test the default launch behavior which is async.
+ * @param   aExeRelPathPrefix
+ *          A string to prefix the ExeRelPath values in the updater.ini.
  */
-function createUpdaterINI(aIsExeAsync) {
+function createUpdaterINI(aIsExeAsync, aExeRelPathPrefix) {
   let exeArg = "ExeArg=post-update-async\n";
   let exeAsync = "";
   if (aIsExeAsync !== undefined) {
     if (aIsExeAsync) {
       exeAsync = "ExeAsync=true\n";
     } else {
       exeArg = "ExeArg=post-update-sync\n";
       exeAsync = "ExeAsync=false\n";
     }
   }
 
+  if (aExeRelPathPrefix && IS_WIN) {
+    aExeRelPathPrefix = aExeRelPathPrefix.replace("/", "\\");
+  }
+
+  let exeRelPathMac = "ExeRelPath=" + aExeRelPathPrefix + DIR_RESOURCES +
+                      gPostUpdateBinFile + "\n";
+  let exeRelPathWin = "ExeRelPath=" + aExeRelPathPrefix + gPostUpdateBinFile + "\n";
   let updaterIniContents = "[Strings]\n" +
                            "Title=Update Test\n" +
                            "Info=Running update test " + gTestID + "\n\n" +
                            "[PostUpdateMac]\n" +
-                           "ExeRelPath=" + DIR_RESOURCES + gPostUpdateBinFile + "\n" +
+                           exeRelPathMac +
                            exeArg +
                            exeAsync +
                            "\n" +
                            "[PostUpdateWin]\n" +
-                           "ExeRelPath=" + gPostUpdateBinFile + "\n" +
+                           exeRelPathWin +
                            exeArg +
                            exeAsync;
   let updaterIni = getApplyDirFile(DIR_RESOURCES + FILE_UPDATER_INI, true);
   writeFile(updaterIni, updaterIniContents);
 }
 
 /**
  * Gets the message log path used for assert checks to lessen the length printed
@@ -3280,60 +3299,16 @@ function checkPostUpdateAppLog() {
     }
     Assert.ok(true, "the post update log contents" + MSG_SHOULD_EQUAL);
   }
 
   do_execute_soon(checkPostUpdateAppLogFinished);
 }
 
 /**
- * Helper function for updater service tests for verifying the contents of the
- * updater callback application log which should contain the arguments passed to
- * the callback application.
- */
-function checkCallbackServiceLog() {
-  let expectedLogContents = gServiceLaunchedCallbackArgs.join("\n") + "\n";
-  let logFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
-  logFile.initWithPath(gServiceLaunchedCallbackLog);
-  let logContents = readFile(logFile);
-  // It is possible for the log file contents check to occur before the log file
-  // contents are completely written so wait until the contents are the expected
-  // value. If the contents are never the expected value then the test will
-  // fail by timing out after gTimeoutRuns is greater than MAX_TIMEOUT_RUNS or
-  // the test harness times out the test.
-  if (logContents != expectedLogContents) {
-    gFileInUseTimeoutRuns++;
-    if (gFileInUseTimeoutRuns > FILE_IN_USE_MAX_TIMEOUT_RUNS) {
-      if (logContents == null) {
-        if (logFile.exists()) {
-          logTestInfo("callback service log exists but readFile returned null");
-        } else {
-          logTestInfo("callback service log does not exist");
-        }
-      } else {
-        logTestInfo("callback service log contents are not correct");
-        let aryLog = logContents.split("\n");
-        // xpcshell tests won't display the entire contents so log each line.
-        logTestInfo("contents of " + logFile.path + ":");
-        for (let i = 0; i < aryLog.length; ++i) {
-          logTestInfo(aryLog[i]);
-        }
-      }
-      // This should never happen!
-      do_throw("Unable to find incorrect service callback log contents!");
-    }
-    do_timeout(FILE_IN_USE_TIMEOUT_MS, checkCallbackServiceLog);
-    return;
-  }
-  Assert.ok(true, "the callback service log contents" + MSG_SHOULD_EQUAL);
-
-  waitForFilesInUse();
-}
-
-/**
  * Helper function to check if a file is in use on Windows by making a copy of
  * a file and attempting to delete the original file. If the deletion is
  * successful the copy of the original file is renamed to the original file's
  * name and if the deletion is not successful the copy of the original file is
  * deleted.
  *
  * @param   aFile
  *          An nsIFile for the file to be checked if it is in use.
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js
@@ -0,0 +1,47 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Too long install directory path failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
+                  : STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = "123456789";
+  if (IS_WIN) {
+    path = "\\" + path;
+    path = path.repeat(30); // 300 characters
+    path = "C:" + path;
+  } else {
+    path = "/" + path;
+    path = path.repeat(1000); // 10000 characters
+  }
+
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Install directory path traversal failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
+                  : STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = "123456789";
+  if (IS_WIN) {
+    path = "C:\\" + path + "\\..\\" + path;
+  } else {
+    path = "/" + path + "/../" + path;
+  }
+
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js
@@ -0,0 +1,38 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Different install and working directories for a regular update failure */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR
+                  : STATE_FAILED_INVALID_APPLYTO_DIR_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = getApplyDirFile("..", false).path;
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js
@@ -0,0 +1,43 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Patch directory path traversal failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = getUpdatesPatchDir();
+  if (IS_WIN) {
+    path = path + "\\..\\";
+  } else {
+    path = path + "/../";
+  }
+
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, path, null, null);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js
@@ -0,0 +1,38 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Different install and working directories for a regular update failure */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR
+                  : STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = getApplyDirFile("..", false).path;
+  runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true, null, null, path);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js
@@ -0,0 +1,38 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Working directory path local UNC failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
+                  : STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = "\\\\.\\" + getApplyDirFile(null, false).path;
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js
@@ -0,0 +1,37 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Relative working directory path failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
+                  : STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, "test");
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
@@ -9,48 +9,44 @@
 
 function run_test() {
   if (!setupTestCommon()) {
     return;
   }
 
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
-  setupUpdaterTest(FILE_COMPLETE_MAR, undefined);
+  // The third parameter will test that a full path to the post update binary
+  // doesn't execute.
+  setupUpdaterTest(FILE_COMPLETE_MAR, undefined,
+                   getApplyDirFile(null, true).path + "/");
 }
 
 /**
  * Called after the call to setupUpdaterTest finishes.
  */
 function setupUpdaterTestFinished() {
   runUpdateUsingApp(STATE_SUCCEEDED);
 }
 
 /**
  * Called after the call to runUpdateUsingApp finishes.
  */
 function runUpdateFinished() {
-  checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
   checkAppBundleModTime();
   standardInit();
   Assert.equal(readStatusState(), STATE_NONE,
                "the status file state" + MSG_SHOULD_EQUAL);
   Assert.ok(!gUpdateManager.activeUpdate,
             "the active update should not be defined");
   Assert.equal(gUpdateManager.updateCount, 1,
                "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
   Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
                "the update state" + MSG_SHOULD_EQUAL);
-  checkPostUpdateRunningFile(true);
+  checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getApplyDirFile);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
 
   let updatesDir = getUpdatesPatchDir();
   Assert.ok(updatesDir.exists(),
             MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
 
   let log = getUpdateLog(FILE_UPDATE_LOG);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
@@ -8,17 +8,16 @@ const STATE_AFTER_STAGE = IS_SERVICE_TES
 const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
 
 function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
-  createUpdaterINI(false);
   setupUpdaterTest(FILE_COMPLETE_MAR, false);
 }
 
 /**
  * Called after the call to setupUpdaterTest finishes.
  */
 function setupUpdaterTestFinished() {
   runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js
@@ -13,48 +13,43 @@ function run_test() {
   gTestFiles[gTestFiles.length - 1].originalContents = null;
   gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n";
   gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
   gTestFiles[gTestFiles.length - 2].originalContents = null;
   gTestFiles[gTestFiles.length - 2].compareContents = "FromPartial\n";
   gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
   gTestDirs = gTestDirsPartialSuccess;
   setupDistributionDir();
-  setupUpdaterTest(FILE_PARTIAL_MAR, false);
+  // The third parameter will test that a relative path that contains a
+  // directory traversal to the post update binary doesn't execute.
+  setupUpdaterTest(FILE_PARTIAL_MAR, false, "test/../");
 }
 
 /**
  * Called after the call to setupUpdaterTest finishes.
  */
 function setupUpdaterTestFinished() {
   runUpdate(STATE_SUCCEEDED, false, 0, true);
 }
 
 /**
  * Called after the call to runUpdate finishes.
  */
 function runUpdateFinished() {
-  checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
   checkAppBundleModTime();
   standardInit();
   Assert.equal(readStatusState(), STATE_NONE,
                "the status file state" + MSG_SHOULD_EQUAL);
   Assert.ok(!gUpdateManager.activeUpdate,
             "the active update should not be defined");
   Assert.equal(gUpdateManager.updateCount, 1,
                "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
   Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
                "the update state" + MSG_SHOULD_EQUAL);
-  checkPostUpdateRunningFile(true);
+  checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getApplyDirFile);
   checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
   checkDistributionDir();
   checkCallbackLog();
 }
 
 /**
  * Setup the state of the distribution directory for the test.
deleted file mode 100644
--- a/toolkit/mozapps/update/tests/unit_base_updater/marWrongApplyToDirFailure_win.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Test trying to use an apply-to directory different from the install
- * directory, which should fail.
- */
-
-function run_test() {
-  if (!setupTestCommon()) {
-    return;
-  }
-  gTestFiles = gTestFilesCompleteSuccess;
-  gTestDirs = gTestDirsCompleteSuccess;
-  setTestFilesAndDirsForFailure();
-  setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
-  overrideApplyToDir(getApplyDirPath() + "/../NoSuchDir");
-  // If execv is used the updater process will turn into the callback process
-  // and the updater's return code will be that of the callback process.
-  runUpdate(STATE_FAILED_INVALID_APPLYTO_DIR_ERROR, false, (USE_EXECV ? 0 : 1),
-            false);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
-  standardInit();
-  checkPostUpdateRunningFile(false);
-  checkFilesAfterUpdateFailure(getApplyDirFile);
-  waitForFilesInUse();
-}
--- a/toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini
+++ b/toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini
@@ -5,104 +5,92 @@
 # Tests that require the updater binary. These tests should never run on Android
 # which doesn't use the updater binary as other applications do and are excluded
 # from running the tests in the moz.build file.
 
 [DEFAULT]
 tags = appupdate
 head = head_update.js
 
+[invalidArgInstallDirPathTooLongFailure.js]
+[invalidArgInstallDirPathTraversalFailure.js]
+[invalidArgInstallWorkingDirPathNotSameFailure_win.js]
+skip-if = os != 'win'
+reason = Windows only test
+[invalidArgPatchDirPathTraversalFailure.js]
+[invalidArgStageDirNotInInstallDirFailure_win.js]
+skip-if = os != 'win'
+reason = Windows only test
+[invalidArgWorkingDirPathLocalUNCFailure_win.js]
+skip-if = os != 'win'
+reason = Windows only test
+[invalidArgWorkingDirPathRelativeFailure.js]
 [marSuccessComplete.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 [marSuccessPartial.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 [marFailurePartial.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 [marStageSuccessComplete.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 [marStageSuccessPartial.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 [marVersionDowngrade.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985 and mar signing
 [marWrongChannel.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985 and mar signing
 [marStageFailurePartial.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 [marCallbackAppSuccessComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marCallbackAppSuccessPartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marCallbackAppStageSuccessComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marCallbackAppStageSuccessPartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marAppInUseSuccessComplete.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985 and bug 1164150
 [marAppInUseStageSuccessComplete_unix.js]
 skip-if = os == 'win'
-reason = not a Windows test and bug 1164150
+reason = not a Windows test
 [marAppInUseStageFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marFileLockedFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marFileLockedFailurePartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marFileLockedStageFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marFileLockedStageFailurePartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marFileInUseSuccessComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marFileInUseSuccessPartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marRMRFDirFileInUseSuccessComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marRMRFDirFileInUseSuccessPartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marFileInUseStageFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marFileInUseStageFailurePartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marRMRFDirFileInUseStageFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marRMRFDirFileInUseStageFailurePartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marAppApplyDirLockedStageFailure_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marAppApplyUpdateAppBinInUseStageSuccess_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
+skip-if = os != 'win'
+reason = Windows only test
 [marAppApplyUpdateSuccess.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985 and bug 1164150
 [marAppApplyUpdateStageSuccess.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985 and bug 1164150
-[marWrongApplyToDirFailure_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js
@@ -0,0 +1,47 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Too long install directory path failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
+                  : STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = "123456789";
+  if (IS_WIN) {
+    path = "\\" + path;
+    path = path.repeat(30); // 300 characters
+    path = "C:" + path;
+  } else {
+    path = "/" + path;
+    path = path.repeat(1000); // 10000 characters
+  }
+
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Install directory path traversal failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
+                  : STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = "123456789";
+  if (IS_WIN) {
+    path = "C:\\" + path + "\\..\\" + path;
+  } else {
+    path = "/" + path + "/../" + path;
+  }
+
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js
@@ -0,0 +1,38 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Different install and working directories for a regular update failure */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR
+                  : STATE_FAILED_INVALID_APPLYTO_DIR_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = getApplyDirFile("..", false).path;
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js
@@ -0,0 +1,43 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Patch directory path traversal failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = getUpdatesPatchDir();
+  if (IS_WIN) {
+    path = path + "\\..\\";
+  } else {
+    path = path + "/../";
+  }
+
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, path, null, null);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js
@@ -0,0 +1,38 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Different install and working directories for a regular update failure */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR
+                  : STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = getApplyDirFile("..", false).path;
+  runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true, null, null, path);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js
@@ -0,0 +1,38 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Working directory path local UNC failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
+                  : STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  let path = "\\\\.\\" + getApplyDirFile(null, false).path;
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path);
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js
@@ -0,0 +1,37 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/* Relative working directory path failure test */
+
+const STATE_AFTER_RUNUPDATE =
+  IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
+                  : STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
+
+function run_test() {
+  if (!setupTestCommon()) {
+    return;
+  }
+  gTestFiles = gTestFilesCompleteSuccess;
+  gTestDirs = gTestDirsCompleteSuccess;
+  setTestFilesAndDirsForFailure();
+  setupUpdaterTest(FILE_COMPLETE_MAR, false);
+}
+
+/**
+ * Called after the call to setupUpdaterTest finishes.
+ */
+function setupUpdaterTestFinished() {
+  runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, "test");
+}
+
+/**
+ * Called after the call to runUpdateUsingUpdater finishes.
+ */
+function runUpdateFinished() {
+  standardInit();
+  checkPostUpdateRunningFile(false);
+  checkFilesAfterUpdateFailure(getApplyDirFile);
+  waitForFilesInUse();
+}
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js
@@ -9,48 +9,44 @@
 
 function run_test() {
   if (!setupTestCommon()) {
     return;
   }
 
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
-  setupUpdaterTest(FILE_COMPLETE_MAR, undefined);
+  // The third parameter will test that a full path to the post update binary
+  // doesn't execute.
+  setupUpdaterTest(FILE_COMPLETE_MAR, undefined,
+                   getApplyDirFile(null, true).path + "/");
 }
 
 /**
  * Called after the call to setupUpdaterTest finishes.
  */
 function setupUpdaterTestFinished() {
   runUpdateUsingApp(STATE_SUCCEEDED);
 }
 
 /**
  * Called after the call to runUpdateUsingApp finishes.
  */
 function runUpdateFinished() {
-  checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
   checkAppBundleModTime();
   standardInit();
   Assert.equal(readStatusState(), STATE_NONE,
                "the status file state" + MSG_SHOULD_EQUAL);
   Assert.ok(!gUpdateManager.activeUpdate,
             "the active update should not be defined");
   Assert.equal(gUpdateManager.updateCount, 1,
                "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
   Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
                "the update state" + MSG_SHOULD_EQUAL);
-  checkPostUpdateRunningFile(true);
+  checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getApplyDirFile);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
 
   let updatesDir = getUpdatesPatchDir();
   Assert.ok(updatesDir.exists(),
             MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
 
   let log = getUpdateLog(FILE_UPDATE_LOG);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
@@ -8,17 +8,16 @@ const STATE_AFTER_STAGE = IS_SERVICE_TES
 const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
 
 function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
-  createUpdaterINI(false);
   setupUpdaterTest(FILE_COMPLETE_MAR, false);
 }
 
 /**
  * Called after the call to setupUpdaterTest finishes.
  */
 function setupUpdaterTestFinished() {
   runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js
@@ -13,48 +13,43 @@ function run_test() {
   gTestFiles[gTestFiles.length - 1].originalContents = null;
   gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n";
   gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
   gTestFiles[gTestFiles.length - 2].originalContents = null;
   gTestFiles[gTestFiles.length - 2].compareContents = "FromPartial\n";
   gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
   gTestDirs = gTestDirsPartialSuccess;
   setupDistributionDir();
-  setupUpdaterTest(FILE_PARTIAL_MAR, false);
+  // The third parameter will test that a relative path that contains a
+  // directory traversal to the post update binary doesn't execute.
+  setupUpdaterTest(FILE_PARTIAL_MAR, false, "test/../");
 }
 
 /**
  * Called after the call to setupUpdaterTest finishes.
  */
 function setupUpdaterTestFinished() {
   runUpdate(STATE_SUCCEEDED, false, 0, true);
 }
 
 /**
  * Called after the call to runUpdate finishes.
  */
 function runUpdateFinished() {
-  checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
   checkAppBundleModTime();
   standardInit();
   Assert.equal(readStatusState(), STATE_NONE,
                "the status file state" + MSG_SHOULD_EQUAL);
   Assert.ok(!gUpdateManager.activeUpdate,
             "the active update should not be defined");
   Assert.equal(gUpdateManager.updateCount, 1,
                "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
   Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
                "the update state" + MSG_SHOULD_EQUAL);
-  checkPostUpdateRunningFile(true);
+  checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getApplyDirFile);
   checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
   checkDistributionDir();
   checkCallbackLog();
 }
 
 /**
  * Setup the state of the distribution directory for the test.
--- a/toolkit/mozapps/update/tests/unit_service_updater/xpcshell.ini
+++ b/toolkit/mozapps/update/tests/unit_service_updater/xpcshell.ini
@@ -4,124 +4,80 @@
 
 # Tests that require the updater binary and the maintenance service.
 
 [DEFAULT]
 tags = appupdate
 head = head_update.js
 
 [bootstrapSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
+run-sequentially = Uses the Mozilla Maintenance Service.
+[invalidArgInstallDirPathTooLongFailureSvc.js]
+run-sequentially = Uses the Mozilla Maintenance Service.
+[invalidArgInstallDirPathTraversalFailureSvc.js]
+run-sequentially = Uses the Mozilla Maintenance Service.
+[invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js]
+run-sequentially = Uses the Mozilla Maintenance Service.
+[invalidArgPatchDirPathTraversalFailureSvc.js]
+run-sequentially = Uses the Mozilla Maintenance Service.
+[invalidArgStageDirNotInInstallDirFailureSvc_win.js]
+run-sequentially = Uses the Mozilla Maintenance Service.
+[invalidArgWorkingDirPathLocalUNCFailureSvc_win.js]
+run-sequentially = Uses the Mozilla Maintenance Service.
+[invalidArgWorkingDirPathRelativeFailureSvc.js]
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marSuccessCompleteSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marSuccessPartialSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFailurePartialSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marStageSuccessCompleteSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marStageSuccessPartialSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marStageFailurePartialSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marCallbackAppSuccessCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marCallbackAppSuccessPartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marCallbackAppStageSuccessCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marCallbackAppStageSuccessPartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marAppInUseSuccessCompleteSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marAppInUseStageFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFileLockedFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFileLockedFailurePartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFileLockedStageFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFileLockedStageFailurePartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFileInUseSuccessCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFileInUseSuccessPartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marRMRFDirFileInUseSuccessCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marRMRFDirFileInUseSuccessPartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFileInUseStageFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marFileInUseStageFailurePartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marRMRFDirFileInUseStageFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marRMRFDirFileInUseStageFailurePartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marAppApplyDirLockedStageFailureSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marAppApplyUpdateSuccessSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [marAppApplyUpdateStageSuccessSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
 run-sequentially = Uses the Mozilla Maintenance Service.
 [checkUpdaterSigSvc.js]