toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/
michael@0 3 */
michael@0 4
michael@0 5 /* File in use partial MAR file patch apply success test */
michael@0 6
michael@0 7 function run_test() {
michael@0 8 setupTestCommon();
michael@0 9 gTestFiles = gTestFilesPartialSuccess;
michael@0 10 gTestDirs = gTestDirsPartialSuccess;
michael@0 11 setupUpdaterTest(FILE_PARTIAL_MAR, false, true);
michael@0 12
michael@0 13 // Launch an existing file so it is in use during the update.
michael@0 14 let fileInUseBin = getApplyDirFile(gTestFiles[11].relPathDir +
michael@0 15 gTestFiles[11].fileName);
michael@0 16 let args = [getApplyDirPath() + "a/b/", "input", "output", "-s",
michael@0 17 HELPER_SLEEP_TIMEOUT];
michael@0 18 let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
michael@0 19 createInstance(AUS_Ci.nsIProcess);
michael@0 20 fileInUseProcess.init(fileInUseBin);
michael@0 21 fileInUseProcess.run(false, args, args.length);
michael@0 22
michael@0 23 do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep);
michael@0 24 }
michael@0 25
michael@0 26 function doUpdate() {
michael@0 27 runUpdate(0, STATE_SUCCEEDED);
michael@0 28 }
michael@0 29
michael@0 30 function checkUpdateApplied() {
michael@0 31 setupHelperFinish();
michael@0 32 }
michael@0 33
michael@0 34 function checkUpdate() {
michael@0 35 checkFilesAfterUpdateSuccess();
michael@0 36 checkUpdateLogContains(ERR_BACKUP_DISCARD);
michael@0 37 checkCallbackAppLog();
michael@0 38 }

mercurial