Bug 711692 - appbin fix and SCM lock hang fix. r=rstrong.

This commit is contained in:
Brian R. Bondy 2012-01-04 23:19:19 -05:00
parent 95ad280cda
commit 2fdf796977
2 changed files with 9 additions and 7 deletions

View File

@ -57,6 +57,8 @@
#include "uachelper.h"
#include "updatehelper.h"
extern HANDLE ghSvcStopEvent;
// Wait 15 minutes for an update operation to run at most.
// Updates usually take less than a minute so this seems like a
// significantly large and safe amount of time to wait.
@ -371,7 +373,7 @@ ExecuteServiceCommand(int argc, LPWSTR *argv)
{
if (argc < 3) {
LOG(("Not enough command line arguments to execute a service command\n"));
StopService();
SetEvent(ghSvcStopEvent);
return FALSE;
}
@ -401,6 +403,6 @@ ExecuteServiceCommand(int argc, LPWSTR *argv)
LOG(("service command %ls complete with result: %ls.\n",
argv[1], (result ? L"Success" : L"Failure")));
StopService();
SetEvent(ghSvcStopEvent);
return TRUE;
}

View File

@ -117,7 +117,7 @@ const TEST_HELPER_TIMEOUT = 100;
// Use a copy of the main application executable for the test to avoid main
// executable in use errors.
const FILE_WIN_TEST_EXE = "aus_test_app.exe";
const FILE_WIN_TEST_EXE = "_aus_test_app.exe";
var gTestserver;
@ -590,7 +590,7 @@ function runUpdateUsingService(aInitialStatus, aExpectedStatus,
// Remove the copy of the application executable used for the test on
// Windows if it exists.
let appBinCopy = getCurrentProcessDir();
appBinCopy.append(FILE_WIN_TEST_EXE);
appBinCopy.append(TEST_ID + FILE_WIN_TEST_EXE);
if (appBinCopy.exists()) {
try {
appBinCopy.remove(false);
@ -1636,13 +1636,13 @@ XPCOMUtils.defineLazyGetter(this, "gAppBinPath", function test_gAppBinPath() {
if (appBin.exists()) {
if (IS_WIN) {
let appBinCopy = processDir.clone();
appBinCopy.append(FILE_WIN_TEST_EXE);
appBinCopy.append(TEST_ID + FILE_WIN_TEST_EXE);
if (appBinCopy.exists()) {
appBinCopy.remove(false);
}
appBin.copyTo(processDir, FILE_WIN_TEST_EXE);
appBin.copyTo(processDir, TEST_ID + FILE_WIN_TEST_EXE);
appBin = processDir.clone();
appBin.append(FILE_WIN_TEST_EXE);
appBin.append(TEST_ID + FILE_WIN_TEST_EXE);
}
let appBinPath = appBin.path;
if (/ /.test(appBinPath)) {