michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: /* File in use complete MAR file patch apply success test */ michael@0: michael@0: function run_test() { michael@0: setupTestCommon(); michael@0: gTestFiles = gTestFilesCompleteSuccess; michael@0: gTestDirs = gTestDirsCompleteSuccess; michael@0: setupUpdaterTest(FILE_COMPLETE_MAR, false, true); michael@0: michael@0: // Launch an existing file so it is in use during the update. michael@0: let fileInUseBin = getApplyDirFile(gTestFiles[13].relPathDir + michael@0: gTestFiles[13].fileName); michael@0: let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", michael@0: HELPER_SLEEP_TIMEOUT]; michael@0: let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"]. michael@0: createInstance(AUS_Ci.nsIProcess); michael@0: fileInUseProcess.init(fileInUseBin); michael@0: fileInUseProcess.run(false, args, args.length); michael@0: michael@0: do_timeout(TEST_HELPER_TIMEOUT, waitForHelperSleep); michael@0: } michael@0: michael@0: function doUpdate() { michael@0: runUpdate(0, STATE_SUCCEEDED); michael@0: } michael@0: michael@0: function checkUpdateApplied() { michael@0: setupHelperFinish(); michael@0: } michael@0: michael@0: function checkUpdate() { michael@0: checkFilesAfterUpdateSuccess(); michael@0: checkUpdateLogContains(ERR_BACKUP_DISCARD); michael@0: checkCallbackAppLog(); michael@0: }