mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-25 06:10:35 +00:00
Bug 715746 - Test fixes for allowing updates to be applied on Windows while the browser is open. r=rstrong
--HG-- rename : toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js => toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js rename : toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_xp_win_complete_svc.js => toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_complete_svc.js
This commit is contained in:
parent
90265bf07c
commit
ef8b5a392a
@ -291,5 +291,11 @@ function checkUpdate() {
|
||||
|
||||
checkFilesAfterUpdateSuccess();
|
||||
|
||||
if (IS_WIN) {
|
||||
logTestInfo("testing tobedeleted directory doesn't exist");
|
||||
let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
|
||||
do_check_false(toBeDeletedDir.exists());
|
||||
}
|
||||
|
||||
checkCallbackAppLog();
|
||||
}
|
@ -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();
|
||||
}
|
@ -23,11 +23,12 @@ 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
|
||||
|
@ -4,7 +4,6 @@
|
||||
[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]
|
||||
|
@ -1,3 +1,2 @@
|
||||
[test_0160_appInUse_xp_unix_complete.js]
|
||||
[test_0161_appInUse_xp_unix_complete.js]
|
||||
skip-if = os == 'mac'
|
||||
|
@ -2,9 +2,18 @@
|
||||
* 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
|
||||
@ -17,7 +26,9 @@ const TEST_FILES = [
|
||||
originalContents : "ShouldNotBeReplaced\n",
|
||||
compareContents : "ShouldNotBeReplaced\n",
|
||||
originalFile : null,
|
||||
compareFile : null
|
||||
compareFile : null,
|
||||
originalPerms : 0767,
|
||||
comparePerms : 0767
|
||||
}, {
|
||||
description : "Added by update.manifest (add)",
|
||||
fileName : "precomplete",
|
||||
@ -25,7 +36,9 @@ const TEST_FILES = [
|
||||
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",
|
||||
@ -33,7 +46,9 @@ const TEST_FILES = [
|
||||
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",
|
||||
@ -41,7 +56,9 @@ const TEST_FILES = [
|
||||
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",
|
||||
@ -49,7 +66,9 @@ const TEST_FILES = [
|
||||
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",
|
||||
@ -57,7 +76,9 @@ const TEST_FILES = [
|
||||
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)",
|
||||
@ -66,7 +87,9 @@ const TEST_FILES = [
|
||||
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)",
|
||||
@ -75,7 +98,9 @@ const TEST_FILES = [
|
||||
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)",
|
||||
@ -84,7 +109,9 @@ const TEST_FILES = [
|
||||
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)",
|
||||
@ -93,7 +120,9 @@ const TEST_FILES = [
|
||||
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)",
|
||||
@ -102,7 +131,9 @@ const TEST_FILES = [
|
||||
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)",
|
||||
@ -111,15 +142,19 @@ const TEST_FILES = [
|
||||
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",
|
||||
@ -127,15 +162,19 @@ const TEST_FILES = [
|
||||
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",
|
||||
@ -143,7 +182,9 @@ const TEST_FILES = [
|
||||
originalContents : "ToBeReplacedWithFromComplete\n",
|
||||
compareContents : "FromComplete\n",
|
||||
originalFile : null,
|
||||
compareFile : null
|
||||
compareFile : null,
|
||||
originalPerms : 0677,
|
||||
comparePerms : 0644
|
||||
}, {
|
||||
description : "Added by update.manifest (add)",
|
||||
fileName : "00text0",
|
||||
@ -151,7 +192,9 @@ const TEST_FILES = [
|
||||
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",
|
||||
@ -159,7 +202,9 @@ const TEST_FILES = [
|
||||
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",
|
||||
@ -167,7 +212,9 @@ const TEST_FILES = [
|
||||
originalContents : "ToBeDeleted\n",
|
||||
compareContents : null,
|
||||
originalFile : null,
|
||||
compareFile : null
|
||||
compareFile : null,
|
||||
originalPerms : null,
|
||||
comparePerms : null
|
||||
}, {
|
||||
description : "Removed by precomplete (remove)",
|
||||
fileName : "20png0.png",
|
||||
@ -175,16 +222,18 @@ const TEST_FILES = [
|
||||
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
|
||||
}];
|
||||
@ -201,6 +250,7 @@ function run_test() {
|
||||
|
||||
// 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);
|
||||
@ -211,6 +261,17 @@ function run_test() {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@ -222,16 +283,28 @@ function checkUpdateApplied() {
|
||||
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();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ tail =
|
||||
[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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user