Bug 1529043 - Part 10 (test only) - Change IS_SERVICE_TEST into a global var to quiet eslint undefined errors and remove eslint-disable no-undef from xpcshellUtilsAUS.js. r=mhowell
authorRobert Strong <robert.bugzilla@gmail.com>
Fri, 22 Feb 2019 22:06:15 +0000
changeset 460684 68c5e68c324415dbd6f014e874ef92e3daf1ef65
parent 460683 3314bffa0d510fabaa87292b0d5ef7d23c05a2a4
child 460685 249fb9b3679beb64768b4fb1cfa46d95696dfb5a
push id35596
push userrmaries@mozilla.com
push dateSat, 23 Feb 2019 04:13:22 +0000
treeherdermozilla-central@fdd04819e350 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1529043
milestone67.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
Bug 1529043 - Part 10 (test only) - Change IS_SERVICE_TEST into a global var to quiet eslint undefined errors and remove eslint-disable no-undef from xpcshellUtilsAUS.js. r=mhowell Depends on D20801 Differential Revision: https://phabricator.services.mozilla.com/D20802
toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
toolkit/mozapps/update/tests/unit_base_updater/head_update.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/marAppApplyUpdateAppBinInUseStageSuccess_win.js
toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.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/marCallbackAppStageSuccessComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js
toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessPartial.js
toolkit/mozapps/update/tests/unit_service_updater/head_update.js
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/invalidArgPatchDirPathSuffixFailureSvc.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/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.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/marCallbackAppStageSuccessCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessPartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js
--- a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
+++ b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
@@ -25,18 +25,16 @@
  * "!mMainThread" in nsThreadManager.cpp are due to using timers and it might be
  * possible to fix some or all of these in the test itself.
  * "NS_FAILED(rv)" in nsThreadUtils.cpp are due to using timers and it might be
  * possible to fix some or all of these in the test itself.
  */
 
 "use strict";
 
-/* eslint-disable no-undef */
-
 const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {TestUtils} = ChromeUtils.import("resource://testing-common/TestUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "MockRegistrar",
                                "resource://testing-common/MockRegistrar.jsm");
 
 const Cm = Components.manager;
@@ -106,21 +104,21 @@ const HELPER_SLEEP_TIMEOUT = 180;
 const FILE_IN_USE_TIMEOUT_MS = 1000;
 
 const PIPE_TO_NULL = AppConstants.platform == "win" ? ">nul" : "> /dev/null 2>&1";
 
 const LOG_FUNCTION = info;
 
 const gHTTPHandlerPath = "updates.xml";
 
+var gIsServiceTest;
+var gTestID;
+
 // This default value will be overridden when using the http server.
 var gURLData = URL_HOST + "/";
-
-var gTestID;
-
 var gTestserver;
 
 var gIncrementalDownloadErrorType;
 
 var gResponseBody;
 
 var gProcess;
 var gAppTimer;
@@ -741,34 +739,34 @@ function setupTestCommon(aAppUpdateAutoE
 
   Assert.strictEqual(gTestID, undefined,
                      "gTestID should be 'undefined' (setupTestCommon should " +
                      "only be called once)");
 
   let caller = Components.stack.caller;
   gTestID = caller.filename.toString().split("/").pop().split(".")[0];
 
-  if (gDebugTestLog && !IS_SERVICE_TEST) {
+  if (gDebugTestLog && !gIsServiceTest) {
     if (gTestsToLog.length == 0 || gTestsToLog.includes(gTestID)) {
       let logFile = do_get_file(gTestID + ".log", true);
       if (!logFile.exists()) {
         logFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
       }
       gFOS = Cc["@mozilla.org/network/file-output-stream;1"].
              createInstance(Ci.nsIFileOutputStream);
       gFOS.init(logFile, MODE_WRONLY | MODE_APPEND, PERMS_FILE, 0);
 
       gRealDump = dump;
       dump = dumpOverride;
     }
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", APP_INFO_NAME, "1.0", "2.0");
 
-  if (IS_SERVICE_TEST && !shouldRunServiceTest()) {
+  if (gIsServiceTest && !shouldRunServiceTest()) {
     return false;
   }
 
   do_test_pending();
 
   setDefaultPrefs();
 
   // Don't attempt to show a prompt when an update finishes.
@@ -797,17 +795,17 @@ function setupTestCommon(aAppUpdateAutoE
       gTestID += "_new";
       logTestInfo("using a new directory for the test by changing gTestID " +
                   "since there is an existing test directory that can't be " +
                   "removed, gTestID: " + gTestID);
     }
   }
 
   if (AppConstants.platform == "win") {
-    Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, !!IS_SERVICE_TEST);
+    Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, !!gIsServiceTest);
   }
 
   adjustGeneralPaths();
   createWorldWritableAppUpdateDir();
 
   // Logged once here instead of in the mock directory provider to lessen test
   // log spam.
   debugDump("Updates Directory (UpdRootD) Path: " + getMockUpdRootD().path);
@@ -1649,17 +1647,17 @@ function logUpdateLog(aLogLeafName) {
     logTestInfo("contents of " + updateLog.path + ":");
     aryLogContents.forEach(function RU_LC_FE(aLine) {
       logTestInfo(aLine);
     });
   } else {
     logTestInfo("update log doesn't exist, path: " + updateLog.path);
   }
 
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     let serviceLog = getMaintSvcDir();
     serviceLog.append("logs");
     serviceLog.append("maintenanceservice.log");
     if (serviceLog.exists()) {
       // xpcshell tests won't display the entire contents so log each line.
       let serviceLogContents = readFileBytes(serviceLog).replace(/\r\n/g, "\n");
       serviceLogContents = replaceLogPaths(serviceLogContents);
       let aryLogContents = serviceLogContents.split("\n");
@@ -1715,17 +1713,17 @@ function readServiceLogFile() {
  */
 function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue, aCheckSvcLog,
                    aPatchDirPath, aInstallDirPath, aApplyToDirPath,
                    aCallbackPath) {
   let isInvalidArgTest = !!aPatchDirPath || !!aInstallDirPath ||
                          !!aApplyToDirPath || !!aCallbackPath;
 
   let svcOriginalLog;
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     copyFileToTestAppDir(FILE_MAINTENANCE_SERVICE_BIN, false);
     copyFileToTestAppDir(FILE_MAINTENANCE_SERVICE_INSTALLER_BIN, false);
     if (aCheckSvcLog) {
       svcOriginalLog = readServiceLogFile();
     }
   }
 
   let pid = 0;
@@ -1755,22 +1753,22 @@ function runUpdate(aExpectedStatus, aSwi
   if (aSwitchApp) {
     args[2] = stageDirPath;
     args[3] = pid + "/replace";
   } else {
     args[2] = applyToDirPath;
     args[3] = pid;
   }
 
-  let launchBin = IS_SERVICE_TEST && isInvalidArgTest ? callbackApp : updateBin;
+  let launchBin = gIsServiceTest && isInvalidArgTest ? callbackApp : updateBin;
 
   if (!isInvalidArgTest) {
     args = args.concat([callbackApp.parent.path, callbackApp.path]);
     args = args.concat(gCallbackArgs);
-  } else if (IS_SERVICE_TEST) {
+  } else if (gIsServiceTest) {
     args = ["launch-service", updateBin.path].concat(args);
   } else if (aCallbackPath) {
     args = args.concat([callbackApp.parent.path, aCallbackPath]);
   }
 
   debugDump("launching the program: " + launchBin.path + " " + args.join(" "));
 
   if (aSwitchApp && !isInvalidArgTest) {
@@ -1787,40 +1785,40 @@ function runUpdate(aExpectedStatus, aSwi
 
   resetEnvironment();
 
   if (gPIDPersistProcess) {
     gEnv.set("MOZ_TEST_SHORTER_WAIT_PID", "");
   }
 
   let status = readStatusFile();
-  if ((!IS_SERVICE_TEST && process.exitValue != aExpectedExitValue) ||
+  if ((!gIsServiceTest && process.exitValue != aExpectedExitValue) ||
       status != aExpectedStatus) {
     if (process.exitValue != aExpectedExitValue) {
       logTestInfo("updater exited with unexpected value! Got: " +
                   process.exitValue + ", Expected: " + aExpectedExitValue);
     }
     if (status != aExpectedStatus) {
       logTestInfo("update status is not the expected status! Got: " + status +
                   ", Expected: " + aExpectedStatus);
     }
     logUpdateLog(FILE_LAST_UPDATE_LOG);
   }
 
-  if (!IS_SERVICE_TEST) {
+  if (!gIsServiceTest) {
     Assert.equal(process.exitValue, aExpectedExitValue,
                  "the process exit value" + MSG_SHOULD_EQUAL);
   }
   Assert.equal(status, aExpectedStatus,
                "the update status" + MSG_SHOULD_EQUAL);
 
   Assert.ok(!updateHasBinaryTransparencyErrorResult(),
             "binary transparency is not being processed for now");
 
-  if (IS_SERVICE_TEST && aCheckSvcLog) {
+  if (gIsServiceTest && aCheckSvcLog) {
     let contents = readServiceLogFile();
     Assert.notEqual(contents, svcOriginalLog,
                     "the contents of the maintenanceservice.log should not " +
                     "be the same as the original contents");
     if (!isInvalidArgTest) {
       Assert.notEqual(contents.indexOf(LOG_SVC_SUCCESSFUL_LAUNCH), -1,
                       "the contents of the maintenanceservice.log should " +
                       "contain the successful launch string");
@@ -1892,17 +1890,17 @@ function checkSymlink() {
   Assert.equal(exitValue, 0,
                "the helper process exit value should be 0");
 }
 
 /**
  * Sets the active update and related information for updater tests.
  */
 function setupActiveUpdate() {
-  let pendingState = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  let pendingState = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   let patchProps = {state: pendingState};
   let patches = getLocalPatchString(patchProps);
   let updates = getLocalUpdateString({}, patches);
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeVersionFile(DEFAULT_UPDATE_VERSION);
   writeStatusFile(pendingState);
   reloadUpdateManagerData();
   Assert.ok(!!gUpdateManager.activeUpdate,
@@ -1920,17 +1918,17 @@ function setupActiveUpdate() {
  *          Whether the update is removed after staging. This can happen when
  *          a staging failure occurs.
  */
 async function stageUpdate(aStateAfterStage, aCheckSvcLog,
                            aUpdateRemoved = false) {
   debugDump("start - attempting to stage update");
 
   let svcLogOriginalContents;
-  if (IS_SERVICE_TEST && aCheckSvcLog) {
+  if (gIsServiceTest && aCheckSvcLog) {
     svcLogOriginalContents = readServiceLogFile();
   }
 
   setAppBundleModTime();
   setEnvironment();
   try {
     // Stage the update.
     Cc["@mozilla.org/updates/update-processor;1"].
@@ -1938,17 +1936,17 @@ async function stageUpdate(aStateAfterSt
   } catch (e) {
     Assert.ok(false,
               "error thrown while calling processUpdate, Exception: " + e);
   }
   await waitForEvent("update-staged", aStateAfterStage);
   resetEnvironment();
 
   if (AppConstants.platform == "win") {
-    if (IS_SERVICE_TEST) {
+    if (gIsServiceTest) {
       waitForServiceStop(false);
     } else {
       let updater = getApplyDirFile(FILE_UPDATER_BIN);
       await TestUtils.waitForCondition(() => (!isFileInUse(updater)),
         "Waiting for the file tp not be in use, Path: " + updater.path);
     }
   }
 
@@ -1977,17 +1975,17 @@ async function stageUpdate(aStateAfterSt
       aStateAfterStage == STATE_APPLIED_SVC) {
     Assert.ok(stageDir.exists(),
               MSG_SHOULD_EXIST + getMsgPath(stageDir.path));
   } else {
     Assert.ok(!stageDir.exists(),
               MSG_SHOULD_NOT_EXIST + getMsgPath(stageDir.path));
   }
 
-  if (IS_SERVICE_TEST && aCheckSvcLog) {
+  if (gIsServiceTest && aCheckSvcLog) {
     let contents = readServiceLogFile();
     Assert.notEqual(contents, svcLogOriginalContents,
                     "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");
   }
@@ -4054,17 +4052,17 @@ function setEnvironment() {
               "warn... previous value " + gEnvXPCOMDebugBreak);
   } else {
     debugDump("setting the XPCOM_DEBUG_BREAK environment variable to " +
               "warn... previously it didn't exist");
   }
 
   gEnv.set("XPCOM_DEBUG_BREAK", "warn");
 
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     debugDump("setting MOZ_NO_SERVICE_FALLBACK environment variable to 1");
     gEnv.set("MOZ_NO_SERVICE_FALLBACK", "1");
   }
 }
 
 /**
  * Sets the environment back to the original values after launching the
  * application.
@@ -4110,13 +4108,13 @@ function resetEnvironment() {
   }
 
   if (AppConstants.platform == "win" && gAddedEnvXRENoWindowsCrashDialog) {
     debugDump("removing the XRE_NO_WINDOWS_CRASH_DIALOG environment " +
               "variable");
     gEnv.set("XRE_NO_WINDOWS_CRASH_DIALOG", "");
   }
 
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     debugDump("removing MOZ_NO_SERVICE_FALLBACK environment variable");
     gEnv.set("MOZ_NO_SERVICE_FALLBACK", "");
   }
 }
--- a/toolkit/mozapps/update/tests/unit_base_updater/head_update.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/head_update.js
@@ -1,8 +1,7 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-const IS_SERVICE_TEST = false;
-
 /* import-globals-from ../data/xpcshellUtilsAUS.js */
 load("xpcshellUtilsAUS.js");
+gIsServiceTest = false;
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js
@@ -9,18 +9,18 @@ async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   // The service cannot safely write update.status for this failure.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = "123456789";
   if (AppConstants.platform == "win") {
     path = "\\" + path;
     path = path.repeat(30); // 300 characters
@@ -29,17 +29,17 @@ async function run_test() {
     path = "/" + path;
     path = path.repeat(1000); // 10000 characters
   }
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_INSTALL_DIR_PATH_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js
@@ -9,34 +9,34 @@ async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   // The service cannot safely write update.status for this failure.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = "123456789";
   if (AppConstants.platform == "win") {
     path = "C:\\" + path + "\\..\\" + path;
   } else {
     path = "/" + path + "/../" + path;
   }
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_INSTALL_DIR_PATH_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js
@@ -10,29 +10,29 @@ async function run_test() {
     return;
   }
   // The service cannot safely write update.status for this failure because the
   // check is done before validating the installed updater.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_APPLYTO_DIR_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = getApplyDirFile("..", false).path;
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_APPLYTO_DIR_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js
@@ -5,17 +5,17 @@
 
 /* Patch directory path traversal failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   const STATE_AFTER_RUNUPDATE =
-    IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+    gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = getUpdateDirFile(DIR_PATCH);
   if (AppConstants.platform == "win") {
     path = path + "\\..\\";
   } else {
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js
@@ -11,29 +11,29 @@ async function run_test() {
   }
   // The service cannot safely write update.status for this failure because the
   // check is done before validating the installed updater.
   const STATE_AFTER_RUNUPDATE_BASE =
     STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = getApplyDirFile("..", false).path;
   runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true, null, null, path, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                        SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js
@@ -10,29 +10,29 @@ async function run_test() {
     return;
   }
   // The service cannot safely write update.status for this failure because the
   // check is done before validating the installed updater.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = "\\\\.\\" + getApplyDirFile(null, false).path;
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_WORKING_DIR_PATH_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js
@@ -10,28 +10,28 @@ async function run_test() {
     return;
   }
   // The service cannot safely write update.status for this failure because the
   // check is done before validating the installed updater.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, "test", null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_WORKING_DIR_PATH_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
@@ -6,17 +6,17 @@
  * Test applying an update by staging an update and launching an application to
  * apply it.
  */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true, false);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
   lockDirectory(getGREBinDir().path);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
@@ -6,17 +6,17 @@
  * Test applying an update by staging an update and launching an application to
  * apply it.
  */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, true);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
   // Switch the application to the staged application that was updated.
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
@@ -1,15 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /**
- * Test applying an update by staging an update and launching an application to
- * apply it.
+ * Test applying an update by launching an application to apply it.
  */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
@@ -3,18 +3,18 @@
  */
 
 /* Application in use complete MAR file staged patch apply failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessComplete_win.js
@@ -3,17 +3,17 @@
  */
 
 /* Replace app binary complete MAR file staged patch apply success test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   gCallbackBinFile = "exe0.exe";
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js
@@ -3,17 +3,17 @@
  */
 
 /* Patch app binary partial MAR file staged patch apply success test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesPartialSuccess;
   gTestDirs = gTestDirsPartialSuccess;
   gCallbackBinFile = "exe0.exe";
   await setupUpdaterTest(FILE_PARTIAL_MAR, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
   checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailureComplete_win.js
@@ -3,18 +3,18 @@
  */
 
 /* File in use complete MAR file staged patch apply failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await runHelperFileInUse(gTestFiles[13].relPathDir + gTestFiles[13].fileName,
                            false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailurePartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailurePartial_win.js
@@ -3,18 +3,18 @@
  */
 
 /* File in use partial MAR file staged patch apply failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesPartialSuccess;
   gTestDirs = gTestDirsPartialSuccess;
   await setupUpdaterTest(FILE_PARTIAL_MAR, false);
   await runHelperFileInUse(gTestFiles[11].relPathDir + gTestFiles[11].fileName,
                            false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailureComplete_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailureComplete_win.js
@@ -4,18 +4,18 @@
 
 /* File in use inside removed dir complete MAR file staged patch apply failure
    test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await runHelperFileInUse(gTestDirs[4].relPathDir + gTestDirs[4].subDirs[0] +
                            gTestDirs[4].subDirFiles[0], true);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailurePartial_win.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailurePartial_win.js
@@ -4,18 +4,18 @@
 
 /* File in use inside removed dir partial MAR file staged patch apply failure
    test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesPartialSuccess;
   gTestDirs = gTestDirsPartialSuccess;
   await setupUpdaterTest(FILE_PARTIAL_MAR, false);
   await runHelperFileInUse(gTestDirs[2].relPathDir + gTestDirs[2].files[0],
                            true);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js
@@ -4,17 +4,17 @@
  */
 
 /* General Complete MAR File Staged Patch Apply Test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestFiles[gTestFiles.length - 1].originalContents = null;
   gTestFiles[gTestFiles.length - 1].compareContents = "FromComplete\n";
   gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
   gTestDirs = gTestDirsCompleteSuccess;
   setupSymLinks();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
--- a/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessPartial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessPartial.js
@@ -4,17 +4,17 @@
  */
 
 /* General Partial MAR File Staged Patch Apply Test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesPartialSuccess;
   gTestFiles[gTestFiles.length - 1].originalContents = null;
   gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n";
   gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
   gTestDirs = gTestDirsPartialSuccess;
   preventDistributionFiles();
   await setupUpdaterTest(FILE_PARTIAL_MAR, true);
   await stageUpdate(STATE_AFTER_STAGE, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/head_update.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/head_update.js
@@ -1,8 +1,7 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-const IS_SERVICE_TEST = true;
-
 /* import-globals-from ../data/xpcshellUtilsAUS.js */
 load("xpcshellUtilsAUS.js");
+gIsServiceTest = true;
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js
@@ -9,18 +9,18 @@ async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   // The service cannot safely write update.status for this failure.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = "123456789";
   if (AppConstants.platform == "win") {
     path = "\\" + path;
     path = path.repeat(30); // 300 characters
@@ -29,17 +29,17 @@ async function run_test() {
     path = "/" + path;
     path = path.repeat(1000); // 10000 characters
   }
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_INSTALL_DIR_PATH_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js
@@ -9,34 +9,34 @@ async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   // The service cannot safely write update.status for this failure.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = "123456789";
   if (AppConstants.platform == "win") {
     path = "C:\\" + path + "\\..\\" + path;
   } else {
     path = "/" + path + "/../" + path;
   }
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_INSTALL_DIR_PATH_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js
@@ -10,29 +10,29 @@ async function run_test() {
     return;
   }
   // The service cannot safely write update.status for this failure because the
   // check is done before validating the installed updater.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_APPLYTO_DIR_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = getApplyDirFile("..", false).path;
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_APPLYTO_DIR_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathSuffixFailureSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathSuffixFailureSvc.js
@@ -5,17 +5,17 @@
 
 /* Patch directory path must end with \updates\0 failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   const STATE_AFTER_RUNUPDATE =
-    IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+    gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = getUpdateDirFile(DIR_PATCH).parent.path;
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, path, null, null, null);
   standardInit();
   checkPostUpdateRunningFile(false);
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js
@@ -5,17 +5,17 @@
 
 /* Patch directory path traversal failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   const STATE_AFTER_RUNUPDATE =
-    IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+    gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = getUpdateDirFile(DIR_PATCH);
   if (AppConstants.platform == "win") {
     path = path + "\\..\\";
   } else {
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js
@@ -11,29 +11,29 @@ async function run_test() {
   }
   // The service cannot safely write update.status for this failure because the
   // check is done before validating the installed updater.
   const STATE_AFTER_RUNUPDATE_BASE =
     STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = getApplyDirFile("..", false).path;
   runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true, null, null, path, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                        SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js
@@ -10,29 +10,29 @@ async function run_test() {
     return;
   }
   // The service cannot safely write update.status for this failure because the
   // check is done before validating the installed updater.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   let path = "\\\\.\\" + getApplyDirFile(null, false).path;
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_WORKING_DIR_PATH_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js
@@ -10,28 +10,28 @@ async function run_test() {
     return;
   }
   // The service cannot safely write update.status for this failure because the
   // check is done before validating the installed updater.
   const STATE_AFTER_RUNUPDATE_BASE = STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
   const STATE_AFTER_RUNUPDATE_SERVICE = AppConstants.EARLY_BETA_OR_EARLIER
       ? STATE_PENDING_SVC
       : STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_AFTER_RUNUPDATE_SERVICE
-                                                : STATE_AFTER_RUNUPDATE_BASE;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_AFTER_RUNUPDATE_SERVICE
+                                               : STATE_AFTER_RUNUPDATE_BASE;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   setTestFilesAndDirsForFailure();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, "test", null);
   standardInit();
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateFailure(getApplyDirFile);
   await waitForUpdateXMLFiles();
-  if (IS_SERVICE_TEST) {
+  if (gIsServiceTest) {
     if (AppConstants.EARLY_BETA_OR_EARLIER) {
       checkUpdateManager(STATE_NONE, false, STATE_PENDING_SVC, 0, 1);
     } else {
       checkUpdateManager(STATE_NONE, false, STATE_FAILED,
                          SERVICE_INVALID_WORKING_DIR_PATH_ERROR, 1);
     }
   } else {
     checkUpdateManager(STATE_NONE, false, STATE_FAILED,
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
@@ -6,17 +6,17 @@
  * Test applying an update by staging an update and launching an application to
  * apply it.
  */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true, false);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
   lockDirectory(getGREBinDir().path);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
@@ -6,17 +6,17 @@
  * Test applying an update by staging an update and launching an application to
  * apply it.
  */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, true);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
   // Switch the application to the staged application that was updated.
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js
@@ -1,15 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /**
- * Test applying an update by staging an update and launching an application to
- * apply it.
+ * Test applying an update by launching an application to apply it.
  */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
@@ -3,18 +3,18 @@
  */
 
 /* Application in use complete MAR file staged patch apply failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessCompleteSvc_win.js
@@ -3,17 +3,17 @@
  */
 
 /* Replace app binary complete MAR file staged patch apply success test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   gCallbackBinFile = "exe0.exe";
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessPartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessPartialSvc_win.js
@@ -3,17 +3,17 @@
  */
 
 /* Patch app binary partial MAR file staged patch apply success test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesPartialSuccess;
   gTestDirs = gTestDirsPartialSuccess;
   gCallbackBinFile = "exe0.exe";
   await setupUpdaterTest(FILE_PARTIAL_MAR, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
   checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js
@@ -3,18 +3,18 @@
  */
 
 /* File in use complete MAR file staged patch apply failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await runHelperFileInUse(gTestFiles[13].relPathDir + gTestFiles[13].fileName,
                            false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js
@@ -3,18 +3,18 @@
  */
 
 /* File in use partial MAR file staged patch apply failure test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesPartialSuccess;
   gTestDirs = gTestDirsPartialSuccess;
   await setupUpdaterTest(FILE_PARTIAL_MAR, false);
   await runHelperFileInUse(gTestFiles[11].relPathDir + gTestFiles[11].fileName,
                            false);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailureCompleteSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailureCompleteSvc_win.js
@@ -4,18 +4,18 @@
 
 /* File in use inside removed dir complete MAR file staged patch apply failure
    test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestDirs = gTestDirsCompleteSuccess;
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await runHelperFileInUse(gTestDirs[4].relPathDir + gTestDirs[4].subDirs[0] +
                            gTestDirs[4].subDirFiles[0], true);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailurePartialSvc_win.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailurePartialSvc_win.js
@@ -4,18 +4,18 @@
 
 /* File in use inside removed dir partial MAR file staged patch apply failure
    test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-  const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_RUNUPDATE = gIsServiceTest ? STATE_PENDING_SVC : STATE_PENDING;
   gTestFiles = gTestFilesPartialSuccess;
   gTestDirs = gTestDirsPartialSuccess;
   await setupUpdaterTest(FILE_PARTIAL_MAR, false);
   await runHelperFileInUse(gTestDirs[2].relPathDir + gTestDirs[2].files[0],
                            true);
   await stageUpdate(STATE_AFTER_STAGE, true);
   checkPostUpdateRunningFile(false);
   checkFilesAfterUpdateSuccess(getStageDirFile, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js
@@ -4,17 +4,17 @@
  */
 
 /* General Complete MAR File Staged Patch Apply Test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesCompleteSuccess;
   gTestFiles[gTestFiles.length - 1].originalContents = null;
   gTestFiles[gTestFiles.length - 1].compareContents = "FromComplete\n";
   gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
   gTestDirs = gTestDirsCompleteSuccess;
   setupSymLinks();
   await setupUpdaterTest(FILE_COMPLETE_MAR, false);
   await stageUpdate(STATE_AFTER_STAGE, true);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js
@@ -4,17 +4,17 @@
  */
 
 /* General Partial MAR File Staged Patch Apply Test */
 
 async function run_test() {
   if (!setupTestCommon()) {
     return;
   }
-  const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
+  const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED;
   gTestFiles = gTestFilesPartialSuccess;
   gTestFiles[gTestFiles.length - 1].originalContents = null;
   gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n";
   gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
   gTestDirs = gTestDirsPartialSuccess;
   preventDistributionFiles();
   await setupUpdaterTest(FILE_PARTIAL_MAR, true);
   await stageUpdate(STATE_AFTER_STAGE, true);