Bug 715746 - Test fixes for allowing updates to be applied on Windows while the browser is open. r=rstrong
authorBrian R. Bondy <netzen@gmail.com>
Sun, 28 Apr 2013 18:27:00 -0400
changeset 141111 05533d50f2f7fa60667b89829bd779d7263df7ca
parent 141110 1d92e69d8450f7c9b942c078d223c892f32c178e
child 141119 c8b361ae0c70dc7a700a06093024d97375ed108e
child 141126 de84d3b91af369fa32dfbfe165a34bd6c5d81453
child 141149 af02393720f01cd3a12741a5b4825b4a1927f6d2
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs715746
milestone23.0a1
first release with
nightly linux32
05533d50f2f7 / 23.0a1 / 20130429030926 / files
nightly linux64
05533d50f2f7 / 23.0a1 / 20130429030926 / files
nightly mac
05533d50f2f7 / 23.0a1 / 20130429030926 / files
nightly win32
05533d50f2f7 / 23.0a1 / 20130429030926 / files
nightly win64
05533d50f2f7 / 23.0a1 / 20130429030926 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 715746 - Test fixes for allowing updates to be applied on Windows while the browser is open. r=rstrong
toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js
toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/xpcshell.ini
toolkit/mozapps/update/test/unit/xpcshell_updater_windows.ini
toolkit/mozapps/update/test/unit/xpcshell_updater_xp_unix.ini
toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/xpcshell.ini
rename from toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
rename to toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js
--- a/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
+++ b/toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js
@@ -286,10 +286,16 @@ function checkUpdate() {
     let now = Date.now();
     let applyToDir = getApplyDirFile();
     let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
     do_check_true(timeDiff < MAX_TIME_DIFFERENCE);
   }
 
   checkFilesAfterUpdateSuccess();
 
+  if (IS_WIN) {
+    logTestInfo("testing tobedeleted directory doesn't exist");
+    let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
+    do_check_false(toBeDeletedDir.exists());
+  }
+
   checkCallbackAppLog();
 }
deleted file mode 100644
--- a/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete.js
+++ /dev/null
@@ -1,228 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Application in use complete MAR file patch apply failure test */
-
-const TEST_ID = "0160";
-
-// The files are listed in the same order as they are applied from the mar's
-// update.manifest. Complete updates have remove file and rmdir directory
-// operations located in the precomplete file performed first.
-const TEST_FILES = [
-{
-  description      : "Should never change",
-  fileName         : "channel-prefs.js",
-  relPathDir       : "a/b/defaults/pref/",
-  originalContents : "ShouldNotBeReplaced\n",
-  compareContents  : "ShouldNotBeReplaced\n",
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "precomplete",
-  relPathDir       : "",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/partial_precomplete"
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "searchpluginstext0",
-  relPathDir       : "a/b/searchplugins/",
-  originalContents : "ShouldNotBeReplaced\n",
-  compareContents  : "ShouldNotBeReplaced\n",
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "searchpluginspng1.png",
-  relPathDir       : "a/b/searchplugins/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "searchpluginspng0.png",
-  relPathDir       : "a/b/searchplugins/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "removed-files",
-  relPathDir       : "a/b/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/partial_removed-files"
-}, {
-  description      : "Not added for failed update (add-if)",
-  fileName         : "extensions1text0",
-  relPathDir       : "a/b/extensions/extensions1/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add-if)",
-  fileName         : "extensions1png1.png",
-  relPathDir       : "a/b/extensions/extensions1/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add-if)",
-  fileName         : "extensions1png0.png",
-  relPathDir       : "a/b/extensions/extensions1/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add-if)",
-  fileName         : "extensions0text0",
-  relPathDir       : "a/b/extensions/extensions0/",
-  originalContents : "ShouldNotBeReplaced\n",
-  compareContents  : "ShouldNotBeReplaced\n",
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add-if)",
-  fileName         : "extensions0png1.png",
-  relPathDir       : "a/b/extensions/extensions0/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
-}, {
-  description      : "Not added for failed update (add-if)",
-  fileName         : "extensions0png0.png",
-  relPathDir       : "a/b/extensions/extensions0/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "exe0.exe",
-  relPathDir       : "a/b/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "10text0",
-  relPathDir       : "a/b/1/10/",
-  originalContents : "ShouldNotBeReplaced\n",
-  compareContents  : "ShouldNotBeReplaced\n",
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "0exe0.exe",
-  relPathDir       : "a/b/0/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "00text1",
-  relPathDir       : "a/b/0/00/",
-  originalContents : "ShouldNotBeReplaced\n",
-  compareContents  : "ShouldNotBeReplaced\n",
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "00text0",
-  relPathDir       : "a/b/0/00/",
-  originalContents : "ShouldNotBeReplaced\n",
-  compareContents  : "ShouldNotBeReplaced\n",
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not added for failed update (add)",
-  fileName         : "00png0.png",
-  relPathDir       : "a/b/0/00/",
-  originalContents : null,
-  compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
-}, {
-  description      : "Not removed for failed update (remove)",
-  fileName         : "20text0",
-  relPathDir       : "a/b/2/20/",
-  originalContents : "ShouldNotBeDeleted\n",
-  compareContents  : "ShouldNotBeDeleted\n",
-  originalFile     : null,
-  compareFile      : null
-}, {
-  description      : "Not removed for failed update (remove)",
-  fileName         : "20png0.png",
-  relPathDir       : "a/b/2/20/",
-  originalContents : "ShouldNotBeDeleted\n",
-  compareContents  : "ShouldNotBeDeleted\n",
-  originalFile     : null,
-  compareFile      : null
-}];
-
-ADDITIONAL_TEST_DIRS = [
-{
-  description  : "Not removed for failed update (rmdir)",
-  relPathDir   : "a/b/2/20/",
-  dirRemoved   : false
-}, {
-  description  : "Not removed for failed update (rmdir)",
-  relPathDir   : "a/b/2/",
-  dirRemoved   : false
-}];
-
-function run_test() {
-  do_test_pending();
-  do_register_cleanup(cleanupUpdaterTest);
-
-  setupUpdaterTest(MAR_COMPLETE_FILE);
-
-  // Launch the callback helper application so it is in use during the update
-  let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
-  let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
-  let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
-                           createInstance(AUS_Ci.nsIProcess);
-  callbackAppProcess.init(callbackApp);
-  callbackAppProcess.run(false, args, args.length);
-
-  do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
-}
-
-function doUpdate() {
-  // apply the complete mar
-  let exitValue = runUpdate();
-  logTestInfo("testing updater binary process exitValue for failure when " +
-              "applying a complete mar");
-  do_check_eq(exitValue, 1);
-
-  setupHelperFinish();
-}
-
-function checkUpdate() {
-  logTestInfo("testing update.status should be " + STATE_FAILED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
-  // The update status format for a failure is failed: # where # is the error
-  // code for the failure.
-  do_check_eq(readStatusFile(updatesDir).split(": ")[0], STATE_FAILED);
-
-  checkFilesAfterUpdateFailure();
-  checkUpdateLogContains(ERR_CALLBACK_FILE_IN_USE);
-
-  logTestInfo("testing tobedeleted directory doesn't exist");
-  let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
-  do_check_false(toBeDeletedDir.exists());
-
-  checkCallbackAppLog();
-}
--- a/toolkit/mozapps/update/test/unit/xpcshell.ini
+++ b/toolkit/mozapps/update/test/unit/xpcshell.ini
@@ -18,19 +18,20 @@ tail =
 [test_0073_update_dir_cleanup.js]
 [test_0080_prompt_silent.js]
 [test_0081_prompt_uiAlreadyOpen.js]
 skip-if = toolkit == "gonk"
 reason = custom nsIUpdatePrompt
 ; Tests that require the updater binary
 [include:xpcshell_updater.ini]
 skip-if = os == 'android'
-; Platform-specific updater tests
 [include:xpcshell_updater_windows.ini]
 run-if = os == 'win'
 [include:xpcshell_updater_xp_unix.ini]
 run-if = os == 'linux' || os == 'mac' || os == 'sunos'
+[test_0160_appInUse_complete.js]
+run-if = os == 'linux' || os == 'mac' || os == 'sunos' || os == 'win'
 [test_bug595059.js]
 skip-if = toolkit == "gonk"
 reason = custom nsIUpdatePrompt
 [test_bug794211.js]
 [test_bug833708.js]
 run-if = toolkit == "gonk"
--- a/toolkit/mozapps/update/test/unit/xpcshell_updater_windows.ini
+++ b/toolkit/mozapps/update/test/unit/xpcshell_updater_windows.ini
@@ -1,15 +1,14 @@
 [test_0113_versionDowngradeCheck.js]
 [test_0114_productChannelCheck.js]
 [test_0150_appBinReplaced_xp_win_complete.js]
 [test_0151_appBinPatched_xp_win_partial.js]
 [test_0152_appBinReplaced_xp_win_complete.js]
 [test_0153_appBinPatched_xp_win_partial.js]
-[test_0160_appInUse_xp_win_complete.js]
 [test_0161_appInUse_xp_win_complete.js]
 [test_0162_appInUse_xp_win_complete.js]
 [test_0170_fileLocked_xp_win_complete.js]
 [test_0171_fileLocked_xp_win_partial.js]
 [test_0172_fileLocked_xp_win_complete.js]
 [test_0173_fileLocked_xp_win_partial.js]
 [test_0174_fileLocked_xp_win_complete.js]
 [test_0175_fileLocked_xp_win_partial.js]
--- a/toolkit/mozapps/update/test/unit/xpcshell_updater_xp_unix.ini
+++ b/toolkit/mozapps/update/test/unit/xpcshell_updater_xp_unix.ini
@@ -1,3 +1,2 @@
-[test_0160_appInUse_xp_unix_complete.js]
 [test_0161_appInUse_xp_unix_complete.js]
 skip-if = os == 'mac'
rename from toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_xp_win_complete_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_complete_svc.js
--- a/toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_xp_win_complete_svc.js
+++ b/toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_complete_svc.js
@@ -1,237 +1,310 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* Application in use complete MAR file patch apply failure test */
+/* This test mirrors ../../test/unit/test_0160_appInUse_complete.js but does the
+ * update using the service.  This test only runs on Windows but the blocks like
+ * IS_MACOSX are preserved to make it easy to spot differences between the 2
+ * mirrored tests. */
+
+/* Application in use complete MAR file patch apply success test */
 
 const TEST_ID = "0160_svc";
+// All we care about is that the last modified time has changed so that Mac OS
+// X Launch Services invalidates its cache so the test allows up to one minute
+// difference in the last modified time.
+const MAX_TIME_DIFFERENCE = 60000;
 
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : 0767,
+  comparePerms     : 0767
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
   originalFile     : "data/partial_precomplete",
-  compareFile      : "data/complete_precomplete"
+  compareFile      : "data/complete_precomplete",
+  originalPerms    : 0666,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : 0775,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "data/complete.png",
+  originalPerms    : null,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
   originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png"
+  compareFile      : "data/complete.png",
+  originalPerms    : 0666,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
   originalFile     : "data/partial_removed-files",
-  compareFile      : "data/complete_removed-files"
+  compareFile      : "data/complete_removed-files",
+  originalPerms    : 0666,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : "FromComplete\n",
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : null,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png"
+  compareFile      : "data/complete.png",
+  originalPerms    : 0666,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "data/complete.png",
+  originalPerms    : null,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : null,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "data/complete.png",
+  originalPerms    : null,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "data/complete.png",
+  originalPerms    : null,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/complete.png"
+  originalFile     : "data/partial.png",
+  compareFile      : "data/complete.png",
+  originalPerms    : 0777,
+  comparePerms     : 0755
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : 0767,
+  comparePerms     : 0644
 }, {
-  description      : "Added by update.manifest (add) file in use",
+  description      : "Added by update.manifest (add)",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_after.exe",
-  compareFile      : "data/complete.png"
+  originalFile     : "data/partial.png",
+  compareFile      : "data/complete.png",
+  originalPerms    : 0777,
+  comparePerms     : 0755
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text1",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : 0677,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text0",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : 0775,
+  comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "data/complete.png",
+  originalPerms    : 0776,
+  comparePerms     : 0644
 }, {
   description      : "Removed by precomplete (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ToBeDeleted\n",
   compareContents  : null,
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : null,
+  comparePerms     : null
 }, {
   description      : "Removed by precomplete (remove)",
   fileName         : "20png0.png",
   relPathDir       : "a/b/2/20/",
   originalContents : "ToBeDeleted\n",
   compareContents  : null,
   originalFile     : null,
-  compareFile      : null
+  compareFile      : null,
+  originalPerms    : null,
+  comparePerms     : null
 }];
 
 ADDITIONAL_TEST_DIRS = [
 {
-  description  : "Removed for complete update (rmdir)",
+  description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/20/",
   dirRemoved   : true
 }, {
-  description  : "Removed for complete update (rmdir)",
+  description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
   if (!shouldRunServiceTest()) {
     return;
   }
 
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_FILE);
 
   // Launch the callback helper application so it is in use during the update
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
+  callbackApp.permissions = PERMS_DIRECTORY;
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
 
   do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
 }
 
 function doUpdate() {
+  let applyToDir = getApplyDirFile();
+
+  // For Mac OS X set the last modified time for the root directory to a date in
+  // the past to test that the last modified time is updated on a successful
+  // update (bug 600098).
+  if (IS_MACOSX) {
+    let now = Date.now();
+    let yesterday = now - (1000 * 60 * 60 * 24);
+    applyToDir.lastModifiedTime = yesterday;
+  }
+
   // apply the complete mar
   runUpdateUsingService(STATE_PENDING_SVC, STATE_SUCCEEDED, checkUpdateApplied);
 }
 
 function checkUpdateApplied() {
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_SUCCEEDED);
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
-  // The update status format for a failure is failed: # where # is the error
-  // code for the failure.
-  do_check_eq(readStatusFile(updatesDir).split(": ")[0], STATE_SUCCEEDED);
+  do_check_eq(readStatusFile(updatesDir), STATE_SUCCEEDED);
+
+  // For Mac OS X check that the last modified time for a directory has been
+  // updated after a successful update (bug 600098).
+  if (IS_MACOSX) {
+    logTestInfo("testing last modified time on the apply to directory has " +
+                "changed after a successful update (bug 600098)");
+    let now = Date.now();
+    let applyToDir = getApplyDirFile();
+    let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
+    do_check_true(timeDiff < MAX_TIME_DIFFERENCE);
+  }
 
   checkFilesAfterUpdateSuccess();
   checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
 
-  logTestInfo("testing tobedeleted directory doesn't exist");
-  let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
-  do_check_false(toBeDeletedDir.exists());
+  if (IS_WIN) {
+    logTestInfo("testing tobedeleted directory doesn't exist");
+    let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
+    do_check_false(toBeDeletedDir.exists());
+  }
 
   checkCallbackServiceLog();
 }
+
--- a/toolkit/mozapps/update/test_svc/unit/xpcshell.ini
+++ b/toolkit/mozapps/update/test_svc/unit/xpcshell.ini
@@ -12,17 +12,17 @@ tail =
 [test_0112_general_svc.js]
 [test_0113_general_svc.js]
 [test_0114_general_svc.js]
 [test_0115_general_svc.js]
 [test_0150_appBinReplaced_xp_win_complete_svc.js]
 [test_0151_appBinPatched_xp_win_partial_svc.js]
 [test_0152_appBinReplaced_xp_win_complete_svc.js]
 [test_0153_appBinPatched_xp_win_partial_svc.js]
-[test_0160_appInUse_xp_win_complete_svc.js]
+[test_0160_appInUse_complete_svc.js]
 [test_0161_appInUse_xp_win_complete_svc.js]
 [test_0162_appInUse_xp_win_complete_svc.js]
 [test_0170_fileLocked_xp_win_complete_svc.js]
 [test_0171_fileLocked_xp_win_partial_svc.js]
 [test_0172_fileLocked_xp_win_complete_svc.js]
 [test_0173_fileLocked_xp_win_partial_svc.js]
 [test_0174_fileLocked_xp_win_complete_svc.js]
 [test_0175_fileLocked_xp_win_partial_svc.js]