diff options
Diffstat (limited to 'toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js')
-rw-r--r-- | toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js new file mode 100644 index 000000000..b9f793236 --- /dev/null +++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js @@ -0,0 +1,41 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +/** + * Test applying an update by staging an update and launching an application to + * apply it. + */ + +const STATE_AFTER_STAGE = STATE_PENDING; + +function run_test() { + if (!setupTestCommon()) { + return; + } + + gTestFiles = gTestFilesCompleteSuccess; + gTestDirs = gTestDirsCompleteSuccess; + setTestFilesAndDirsForFailure(); + createUpdateInProgressLockFile(getAppBaseDir()); + setupUpdaterTest(FILE_COMPLETE_MAR, false); +} + +/** + * Called after the call to setupUpdaterTest finishes. + */ +function setupUpdaterTestFinished() { + stageUpdate(false); +} + +/** + * Called after the call to stageUpdate finishes. + */ +function stageUpdateFinished() { + removeUpdateInProgressLockFile(getAppBaseDir()); + checkPostUpdateRunningFile(false); + checkFilesAfterUpdateFailure(getApplyDirFile); + checkUpdateLogContains(PERFORMING_STAGED_UPDATE); + checkUpdateLogContains(ERR_UPDATE_IN_PROGRESS); + waitForFilesInUse(); +} |