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

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

mercurial