test code - Bug 1367910 - Delete active-updates.xml instead of writing to it when there isn't an active update. r=dothayer

This commit is contained in:
Robert Strong 2017-08-31 12:20:22 -07:00
Родитель f0d8f05280
Коммит 9084ce73bb
87 изменённых файлов: 325 добавлений и 533 удалений

Просмотреть файл

@ -120,11 +120,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "gEnv",
"@mozilla.org/process/environment;1",
"nsIEnvironment");
XPCOMUtils.defineLazyGetter(this, "gZipW", function test_gZipW() {
return Cc["@mozilla.org/zipwriter;1"].
createInstance(Ci.nsIZipWriter);
});
/* Triggers post-update processing */
function testPostUpdateProcessing() {
gAUS.observe(null, "test-post-update-processing", "");

Просмотреть файл

@ -45,6 +45,12 @@ const INVALID_WORKING_DIR_PATH_ERROR = 76;
const INVALID_CALLBACK_PATH_ERROR = 77;
const INVALID_CALLBACK_DIR_ERROR = 78;
// Error codes 80 through 99 are reserved for nsUpdateService.js and are not
// defined in common/errors.h
const ERR_OLDER_VERSION_OR_SAME_BUILD = 90;
const ERR_UPDATE_STATE_NONE = 91;
const ERR_CHANNEL_CHANGE = 92;
const STATE_FAILED_DELIMETER = ": ";
const STATE_FAILED_LOADSOURCE_ERROR_WRONG_SIZE =
@ -111,16 +117,16 @@ function getRemoteUpdatesXMLString(aUpdates) {
*/
function getRemoteUpdateString(aUpdateProps, aPatches) {
const updateProps = {
type: "major",
name: "App Update Test",
displayVersion: null,
appVersion: DEFAULT_UPDATE_VERSION,
buildID: "20080811053724",
detailsURL: URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS",
promptWaitTime: null,
backgroundInterval: null,
buildID: "20080811053724",
custom1: null,
custom2: null
custom2: null,
detailsURL: URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS",
displayVersion: null,
name: "App Update Test",
promptWaitTime: null,
type: "major"
};
for (let name in aUpdateProps) {
@ -196,9 +202,6 @@ function getLocalUpdatesXMLString(aUpdates) {
*/
function getLocalUpdateString(aUpdateProps, aPatches) {
const updateProps = {
type: "major",
name: "App Update Test",
displayVersion: null,
_appVersion: null,
get appVersion() {
if (this._appVersion) {
@ -212,46 +215,49 @@ function getLocalUpdateString(aUpdateProps, aPatches) {
set appVersion(val) {
this._appVersion = val;
},
buildID: "20080811053724",
detailsURL: URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS",
promptWaitTime: null,
backgroundInterval: null,
buildID: "20080811053724",
channel: gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL),
custom1: null,
custom2: null,
serviceURL: "http://test_service/",
installDate: "1238441400314",
statusText: "Install Pending",
isCompleteUpdate: "true",
channel: gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL),
detailsURL: URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS",
displayVersion: null,
foregroundDownload: "true",
previousAppVersion: null
installDate: "1238441400314",
isCompleteUpdate: "true",
name: "App Update Test",
previousAppVersion: null,
promptWaitTime: null,
serviceURL: "http://test_service/",
statusText: "Install Pending",
type: "major"
};
for (let name in aUpdateProps) {
updateProps[name] = aUpdateProps[name];
}
let previousAppVersion = updateProps.previousAppVersion ?
"previousAppVersion=\"" + updateProps.previousAppVersion + "\" " : "";
let serviceURL = "serviceURL=\"" + updateProps.serviceURL + "\" ";
let installDate = "installDate=\"" + updateProps.installDate + "\" ";
let statusText = updateProps.statusText ?
"statusText=\"" + updateProps.statusText + "\" " : "";
let channel = "channel=\"" + updateProps.channel + "\" ";
let isCompleteUpdate =
"isCompleteUpdate=\"" + updateProps.isCompleteUpdate + "\" ";
let channel = "channel=\"" + updateProps.channel + "\" ";
let foregroundDownload = updateProps.foregroundDownload ?
"foregroundDownload=\"" + updateProps.foregroundDownload + "\">" : ">";
"foregroundDownload=\"" + updateProps.foregroundDownload + "\" " : "";
let installDate = "installDate=\"" + updateProps.installDate + "\" ";
let previousAppVersion = updateProps.previousAppVersion ?
"previousAppVersion=\"" + updateProps.previousAppVersion + "\" " : "";
let statusText = updateProps.statusText ?
"statusText=\"" + updateProps.statusText + "\" " : "";
let serviceURL = "serviceURL=\"" + updateProps.serviceURL + "\">";
return getUpdateString(updateProps) +
" " +
previousAppVersion +
serviceURL +
installDate +
statusText +
isCompleteUpdate +
channel +
isCompleteUpdate +
foregroundDownload +
installDate +
previousAppVersion +
statusText +
serviceURL +
aPatches +
"</update>";
}

Просмотреть файл

@ -1080,6 +1080,51 @@ function checkAppBundleModTime() {
"change after a successful update");
}
/**
* Performs Update Manager checks to verify that the update metadata is correct
* and that it is the same after the update xml files are reloaded.
*
* @param aStatusFileState
* The expected state of the status file.
* @param aHasActiveUpdate
* Should there be an active update.
* @param aUpdateStatusState
* The expected update's status state.
* @param aUpdateErrCode
* The expected update's error code.
* @param aUpdateCount
* The update history's update count.
*/
function checkUpdateManager(aStatusFileState, aHasActiveUpdate,
aUpdateStatusState, aUpdateErrCode, aUpdateCount) {
Assert.equal(readStatusState(), aStatusFileState,
"the status file state" + MSG_SHOULD_EQUAL);
let msgTags = [" after startup ", " after a file reload "];
for (let i = 0; i < msgTags.length; ++i) {
logTestInfo("checking Update Manager updates" + msgTags[i]) +
"is performed";
if (aHasActiveUpdate) {
Assert.ok(!!gUpdateManager.activeUpdate, msgTags[i] +
"the active update should be defined");
} else {
Assert.ok(!gUpdateManager.activeUpdate, msgTags[i] +
"the active update should not be defined");
}
Assert.equal(gUpdateManager.updateCount, aUpdateCount, msgTags[i] +
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
if (aUpdateCount > 0) {
let update = gUpdateManager.getUpdateAt(0);
Assert.equal(update.state, aUpdateStatusState, msgTags[i] +
"the first update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.errorCode, aUpdateErrCode, msgTags[i] +
"the first update errorCode" + MSG_SHOULD_EQUAL);
}
if (i != msgTags.length - 1) {
reloadUpdateManagerData();
}
}
}
/**
* On Mac OS X and Windows this checks if the post update '.running' file exists
* to determine if the post update binary was launched.
@ -1968,11 +2013,6 @@ function checkUpdateStagedState(aUpdateState) {
"the update state" + MSG_SHOULD_EQUAL);
}
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_STAGE,
"the update state" + MSG_SHOULD_EQUAL);
let log = getUpdateLog(FILE_LAST_UPDATE_LOG);
Assert.ok(log.exists(),
MSG_SHOULD_EXIST + getMsgPath(log.path));

Просмотреть файл

@ -28,19 +28,25 @@ function run_test() {
standardInit();
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager update count" + MSG_SHOULD_EQUAL);
let update = gUpdateManager.getUpdateAt(0);
Assert.equal(update.name, "Existing",
"the update's name" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"there should not be an active update");
// Verify that the active-update.xml file has had the update from the old
// channel removed.
let file = getUpdatesXMLFile(true);
Assert.equal(readFile(file), getLocalUpdatesXMLString(""),
"the contents of active-update.xml" + MSG_SHOULD_EQUAL);
let activeUpdateXML = getUpdatesXMLFile(true);
Assert.ok(!activeUpdateXML.exists(),
MSG_SHOULD_NOT_EXIST + getMsgPath(activeUpdateXML.path));
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager update count" + MSG_SHOULD_EQUAL);
let update = gUpdateManager.getUpdateAt(0);
Assert.equal(update.state, STATE_FAILED,
"the first update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.errorCode, ERR_CHANNEL_CHANGE,
"the first update errorCode" + MSG_SHOULD_EQUAL);
Assert.equal(update.statusText, getString("statusFailed"),
"the first update statusText " + MSG_SHOULD_EQUAL);
update = gUpdateManager.getUpdateAt(1);
Assert.equal(update.state, STATE_FAILED,
"the second update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.name, "Existing",
"the second update name" + MSG_SHOULD_EQUAL);
doTestFinish();
}

Просмотреть файл

@ -17,12 +17,33 @@ function run_test() {
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
writeStatusFile(STATE_DOWNLOADING);
patchProps = {state: STATE_FAILED};
patches = getLocalPatchString(patchProps);
updateProps = {name: "Existing"};
updates = getLocalUpdateString(updateProps, patches);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), false);
standardInit();
Assert.ok(!gUpdateManager.activeUpdate,
"there should not be an active update");
Assert.equal(gUpdateManager.updateCount, 0,
let activeUpdateXML = getUpdatesXMLFile(true);
Assert.ok(!activeUpdateXML.exists(),
MSG_SHOULD_NOT_EXIST + getMsgPath(activeUpdateXML.path));
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager update count" + MSG_SHOULD_EQUAL);
let update = gUpdateManager.getUpdateAt(0);
Assert.equal(update.state, STATE_FAILED,
"the first update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.errorCode, ERR_OLDER_VERSION_OR_SAME_BUILD,
"the first update errorCode" + MSG_SHOULD_EQUAL);
Assert.equal(update.statusText, getString("statusFailed"),
"the first update statusText " + MSG_SHOULD_EQUAL);
update = gUpdateManager.getUpdateAt(1);
Assert.equal(update.state, STATE_FAILED,
"the second update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.name, "Existing",
"the second update name" + MSG_SHOULD_EQUAL);
doTestFinish();
}

Просмотреть файл

@ -18,12 +18,33 @@ function run_test() {
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
writeStatusFile(STATE_DOWNLOADING);
patchProps = {state: STATE_FAILED};
patches = getLocalPatchString(patchProps);
updateProps = {name: "Existing"};
updates = getLocalUpdateString(updateProps, patches);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), false);
standardInit();
Assert.ok(!gUpdateManager.activeUpdate,
"there should not be an active update");
Assert.equal(gUpdateManager.updateCount, 0,
let activeUpdateXML = getUpdatesXMLFile(true);
Assert.ok(!activeUpdateXML.exists(),
MSG_SHOULD_NOT_EXIST + getMsgPath(activeUpdateXML.path));
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager update count" + MSG_SHOULD_EQUAL);
let update = gUpdateManager.getUpdateAt(0);
Assert.equal(update.state, STATE_FAILED,
"the first update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.errorCode, ERR_OLDER_VERSION_OR_SAME_BUILD,
"the first update errorCode" + MSG_SHOULD_EQUAL);
Assert.equal(update.statusText, getString("statusFailed"),
"the first update statusText " + MSG_SHOULD_EQUAL);
update = gUpdateManager.getUpdateAt(1);
Assert.equal(update.state, STATE_FAILED,
"the second update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.name, "Existing",
"the second update name" + MSG_SHOULD_EQUAL);
doTestFinish();
}

Просмотреть файл

@ -15,8 +15,34 @@ function run_test() {
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
writeStatusFile(STATE_NONE);
patchProps = {state: STATE_FAILED};
patches = getLocalPatchString(patchProps);
let updateProps = {name: "Existing"};
updates = getLocalUpdateString(updateProps, patches);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), false);
standardInit();
Assert.ok(!gUpdateManager.activeUpdate,
"there should not be an active update");
let activeUpdateXML = getUpdatesXMLFile(true);
Assert.ok(!activeUpdateXML.exists(),
MSG_SHOULD_NOT_EXIST + getMsgPath(activeUpdateXML.path));
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager update count" + MSG_SHOULD_EQUAL);
let update = gUpdateManager.getUpdateAt(0);
Assert.equal(update.state, STATE_FAILED,
"the first update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.errorCode, ERR_UPDATE_STATE_NONE,
"the first update errorCode" + MSG_SHOULD_EQUAL);
Assert.equal(update.statusText, getString("statusFailed"),
"the first update statusText " + MSG_SHOULD_EQUAL);
update = gUpdateManager.getUpdateAt(1);
Assert.equal(update.state, STATE_FAILED,
"the second update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.name, "Existing",
"the second update name" + MSG_SHOULD_EQUAL);
let dir = getUpdatesDir();
dir.append(DIR_PATCH);
Assert.ok(dir.exists(), MSG_SHOULD_EXIST);
@ -25,10 +51,5 @@ function run_test() {
statusFile.append(FILE_UPDATE_STATUS);
Assert.ok(!statusFile.exists(), MSG_SHOULD_NOT_EXIST);
Assert.ok(!gUpdateManager.activeUpdate,
"there should not be an active update");
Assert.equal(gUpdateManager.updateCount, 0,
"the update manager update count" + MSG_SHOULD_EQUAL);
doTestFinish();
}

Просмотреть файл

@ -15,14 +15,35 @@ function run_test() {
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
writeVersionFile("99.9");
patchProps = {state: STATE_FAILED};
patches = getLocalPatchString(patchProps);
let updateProps = {name: "Existing"};
updates = getLocalUpdateString(updateProps, patches);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), false);
standardInit();
// Check that there is no activeUpdate first so the updates directory is
// cleaned up by the UpdateManager before the remaining tests.
Assert.ok(!gUpdateManager.activeUpdate,
"there should not be an active update");
Assert.equal(gUpdateManager.updateCount, 0,
let activeUpdateXML = getUpdatesXMLFile(true);
Assert.ok(!activeUpdateXML.exists(),
MSG_SHOULD_NOT_EXIST + getMsgPath(activeUpdateXML.path));
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager update count" + MSG_SHOULD_EQUAL);
let update = gUpdateManager.getUpdateAt(0);
Assert.equal(update.state, STATE_FAILED,
"the first update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.errorCode, ERR_UPDATE_STATE_NONE,
"the first update errorCode" + MSG_SHOULD_EQUAL);
Assert.equal(update.statusText, getString("statusFailed"),
"the first update statusText " + MSG_SHOULD_EQUAL);
update = gUpdateManager.getUpdateAt(1);
Assert.equal(update.state, STATE_FAILED,
"the second update state" + MSG_SHOULD_EQUAL);
Assert.equal(update.name, "Existing",
"the second update name" + MSG_SHOULD_EQUAL);
let dir = getUpdatesDir();
dir.append(DIR_PATCH);

Просмотреть файл

@ -18,7 +18,7 @@ function run_test() {
standardInit();
Assert.equal(gUpdateManager.updateCount, 1,
Assert.equal(gUpdateManager.updateCount, 0,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.activeUpdate.state, STATE_DOWNLOADING,
"the update manager activeUpdate state attribute" +

Просмотреть файл

@ -31,6 +31,8 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
INVALID_CALLBACK_DIR_ERROR, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -39,6 +39,8 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
INVALID_CALLBACK_PATH_ERROR, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -41,6 +41,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
: INVALID_INSTALL_DIR_PATH_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -38,6 +38,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
: INVALID_INSTALL_DIR_PATH_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -32,6 +32,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_APPLYTO_DIR_ERROR
: INVALID_APPLYTO_DIR_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -37,6 +37,7 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -32,6 +32,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR
: INVALID_APPLYTO_DIR_STAGED_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -32,6 +32,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_WORKING_DIR_PATH_ERROR
: INVALID_WORKING_DIR_PATH_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -31,6 +31,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_WORKING_DIR_PATH_ERROR
: INVALID_WORKING_DIR_PATH_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -32,6 +32,7 @@ function setupUpdaterTestFinished() {
* Called after the call to stageUpdate finishes.
*/
function stageUpdateFinished() {
checkUpdateManager(STATE_AFTER_STAGE, true, STATE_AFTER_STAGE, 0, 0);
removeUpdateInProgressLockFile(getAppBaseDir());
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -51,14 +51,7 @@ function runUpdateFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -35,17 +35,9 @@ function stageUpdateFinished() {
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getStageDirFile, true);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
// Change the active update to an older version to simulate installing a new
// version of the application while there is an update that has been staged.
let patchProps = {state: STATE_AFTER_STAGE};
let patches = getLocalPatchString(patchProps);
let updateProps = {appVersion: "1.0"};
let updates = getLocalUpdateString(updateProps, patches);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
// Change the version file to an older version to simulate installing a new
// version of the application while there is an update that has been staged.
writeVersionFile("1.0");
reloadUpdateManagerData();
writeVersionFile("0.9");
// Try to switch the application to the staged application that was updated.
runUpdateUsingApp(STATE_AFTER_STAGE);
}
@ -54,15 +46,19 @@ function stageUpdateFinished() {
* Called after the call to runUpdateUsingApp finishes.
*/
function runUpdateFinished() {
// Change the active update to an older version to simulate installing a new
// version of the application while there is an update that has been staged.
let patchProps = {state: STATE_AFTER_STAGE};
let patches = getLocalPatchString(patchProps);
let updateProps = {appVersion: "0.9"};
let updates = getLocalUpdateString(updateProps, patches);
getUpdatesXMLFile(true).remove(false);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
reloadUpdateManagerData();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_STAGE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
ERR_OLDER_VERSION_OR_SAME_BUILD, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile, !IS_MACOSX, false);

Просмотреть файл

@ -50,14 +50,7 @@ function runUpdateFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -33,14 +33,7 @@ function setupUpdaterTestFinished() {
function runUpdateFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -53,14 +53,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -66,14 +66,7 @@ function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
checkSymLinks();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -47,14 +47,7 @@ function waitForHelperExitFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -46,14 +46,7 @@ function runUpdateFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -46,14 +46,7 @@ function runUpdateFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -33,14 +33,7 @@ function runUpdateFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -33,14 +33,7 @@ function runUpdateFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_PARTIAL_SUCCESS);

Просмотреть файл

@ -32,14 +32,8 @@ function setupUpdaterTestFinished() {
function runUpdateFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusFile(), STATE_NONE,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, LOADSOURCE_ERROR_WRONG_SIZE,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
LOADSOURCE_ERROR_WRONG_SIZE, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContents(LOG_PARTIAL_FAILURE);

Просмотреть файл

@ -54,10 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -54,10 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -47,14 +47,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContains(ERR_BACKUP_DISCARD);

Просмотреть файл

@ -47,14 +47,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContains(ERR_BACKUP_DISCARD);

Просмотреть файл

@ -40,14 +40,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusFile(), STATE_PENDING,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_PENDING,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, WRITE_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_PENDING, true, STATE_PENDING, WRITE_ERROR, 0);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_RENAME_FILE);

Просмотреть файл

@ -40,14 +40,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusFile(), STATE_NONE,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, READ_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED, READ_ERROR, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);

Просмотреть файл

@ -54,14 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusFile(), STATE_PENDING,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_PENDING,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, WRITE_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_PENDING, true, STATE_PENDING, WRITE_ERROR, 0);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_RENAME_FILE);

Просмотреть файл

@ -54,14 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusFile(), STATE_NONE,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, READ_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED, READ_ERROR, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);

Просмотреть файл

@ -50,14 +50,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContains(ERR_PARENT_PID_PERSISTS);

Просмотреть файл

@ -55,14 +55,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -54,14 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -47,14 +47,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContains(ERR_BACKUP_DISCARD);

Просмотреть файл

@ -46,14 +46,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContains(ERR_BACKUP_DISCARD);

Просмотреть файл

@ -30,10 +30,8 @@ function setupUpdaterTestFinished() {
* Called after the call to stageUpdate finishes.
*/
function stageUpdateFinished() {
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, LOADSOURCE_ERROR_WRONG_SIZE,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
LOADSOURCE_ERROR_WRONG_SIZE, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_LOADSOURCEFILE_FAILED);

Просмотреть файл

@ -53,14 +53,7 @@ function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
checkSymLinks();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -52,14 +52,7 @@ function runUpdateFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true, true);

Просмотреть файл

@ -36,14 +36,7 @@ function runUpdateFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS, false, false, true);

Просмотреть файл

@ -36,14 +36,7 @@ function setupUpdaterTestFinished() {
function runUpdateFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_PARTIAL_SUCCESS);

Просмотреть файл

@ -34,16 +34,8 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, VERSION_DOWNGRADE_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
VERSION_DOWNGRADE_ERROR, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(STATE_FAILED_VERSION_DOWNGRADE_ERROR);

Просмотреть файл

@ -34,16 +34,8 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, MAR_CHANNEL_MISMATCH_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
MAR_CHANNEL_MISMATCH_ERROR, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(STATE_FAILED_MAR_CHANNEL_MISMATCH_ERROR);

Просмотреть файл

@ -41,6 +41,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
: INVALID_INSTALL_DIR_PATH_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -38,6 +38,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
: INVALID_INSTALL_DIR_PATH_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -32,6 +32,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_APPLYTO_DIR_ERROR
: INVALID_APPLYTO_DIR_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -31,6 +31,7 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -37,6 +37,7 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -32,6 +32,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR
: INVALID_APPLYTO_DIR_STAGED_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -32,6 +32,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_WORKING_DIR_PATH_ERROR
: INVALID_WORKING_DIR_PATH_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -31,6 +31,9 @@ function setupUpdaterTestFinished() {
*/
function runUpdateFinished() {
standardInit();
let errorCode = IS_SERVICE_TEST ? SERVICE_INVALID_WORKING_DIR_PATH_ERROR
: INVALID_WORKING_DIR_PATH_ERROR;
checkUpdateManager(STATE_NONE, false, STATE_FAILED, errorCode, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();

Просмотреть файл

@ -32,6 +32,7 @@ function setupUpdaterTestFinished() {
* Called after the call to stageUpdate finishes.
*/
function stageUpdateFinished() {
checkUpdateManager(STATE_AFTER_STAGE, true, STATE_AFTER_STAGE, 0, 0);
removeUpdateInProgressLockFile(getAppBaseDir());
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -51,14 +51,7 @@ function runUpdateFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -50,14 +50,7 @@ function runUpdateFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -33,14 +33,7 @@ function setupUpdaterTestFinished() {
function runUpdateFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -53,14 +53,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -47,14 +47,7 @@ function waitForHelperExitFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -46,14 +46,7 @@ function runUpdateFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -46,14 +46,7 @@ function runUpdateFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -33,14 +33,7 @@ function runUpdateFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -33,14 +33,7 @@ function runUpdateFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_PARTIAL_SUCCESS);

Просмотреть файл

@ -32,14 +32,8 @@ function setupUpdaterTestFinished() {
function runUpdateFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusFile(), STATE_NONE,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, LOADSOURCE_ERROR_WRONG_SIZE,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
LOADSOURCE_ERROR_WRONG_SIZE, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContents(LOG_PARTIAL_FAILURE);

Просмотреть файл

@ -54,10 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -54,10 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -47,14 +47,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContains(ERR_BACKUP_DISCARD);

Просмотреть файл

@ -47,14 +47,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContains(ERR_BACKUP_DISCARD);

Просмотреть файл

@ -40,14 +40,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusFile(), STATE_PENDING,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_PENDING,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, WRITE_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_PENDING, true, STATE_PENDING, WRITE_ERROR, 0);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_RENAME_FILE);

Просмотреть файл

@ -40,14 +40,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusFile(), STATE_NONE,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, READ_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED, READ_ERROR, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);

Просмотреть файл

@ -54,14 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusFile(), STATE_PENDING,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_PENDING,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, WRITE_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_PENDING, true, STATE_PENDING, WRITE_ERROR, 0);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_RENAME_FILE);

Просмотреть файл

@ -54,14 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusFile(), STATE_NONE,
"the status file failure code" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
"the update state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, READ_ERROR,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED, READ_ERROR, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);

Просмотреть файл

@ -55,14 +55,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -54,14 +54,7 @@ function runUpdateFinished() {
*/
function waitForHelperExitFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_AFTER_RUNUPDATE, 0, 1);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile);

Просмотреть файл

@ -47,14 +47,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContains(ERR_BACKUP_DISCARD);

Просмотреть файл

@ -46,14 +46,7 @@ function waitForHelperExitFinished() {
*/
function checkPostUpdateAppLogFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContains(ERR_BACKUP_DISCARD);

Просмотреть файл

@ -30,10 +30,8 @@ function setupUpdaterTestFinished() {
* Called after the call to stageUpdate finishes.
*/
function stageUpdateFinished() {
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, LOADSOURCE_ERROR_WRONG_SIZE,
"the update errorCode" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_FAILED,
LOADSOURCE_ERROR_WRONG_SIZE, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
checkUpdateLogContains(ERR_LOADSOURCEFILE_FAILED);

Просмотреть файл

@ -53,14 +53,7 @@ function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
checkSymLinks();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);

Просмотреть файл

@ -52,14 +52,7 @@ function runUpdateFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true, true);

Просмотреть файл

@ -36,14 +36,7 @@ function runUpdateFinished() {
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(true);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS, false, false, true);

Просмотреть файл

@ -36,14 +36,7 @@ function setupUpdaterTestFinished() {
function runUpdateFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkUpdateManager(STATE_NONE, false, STATE_SUCCEEDED, 0, 1);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_PARTIAL_SUCCESS);