Partial fix (all but test_0201_app_launch_apply_update_svc.js) for - Bug 762032 - Intermittent test_0201_app_launch_apply_update.js, test_0201_app_launch_apply_update_svc.js test_0203_app_launch_apply_update_svc.js | WindowsError: [Error 13] The process cannot access the file because it is being used by another process: '...helper.exe'. r=bbondy

This commit is contained in:
Robert Strong 2012-12-13 09:43:27 -08:00
Родитель 6d613b7d05
Коммит 354b08bcf4
6 изменённых файлов: 96 добавлений и 11 удалений

Просмотреть файл

@ -162,6 +162,14 @@ function run_test() {
gActiveUpdate = gUpdateManager.activeUpdate;
do_check_true(!!gActiveUpdate);
// Backup the updater.ini if it exists by moving it. This prevents the post
// update executable from being launched if it is specified.
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI_BAK);
}
let updateSettingsIni = processDir.clone();
updateSettingsIni.append(UPDATE_SETTINGS_INI_FILE);
writeFile(updateSettingsIni, UPDATE_SETTINGS_CONTENTS);
@ -208,6 +216,14 @@ function end_test() {
resetEnvironment();
let processDir = getAppDir();
// Restore the backup of the updater.ini if it exists
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI_BAK);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI);
}
// Remove the files added by the update.
let updateTestDir = getUpdateTestDir();
try {

Просмотреть файл

@ -168,6 +168,14 @@ function run_test() {
gActiveUpdate = gUpdateManager.activeUpdate;
do_check_true(!!gActiveUpdate);
// Backup the updater.ini if it exists by moving it. This prevents the post
// update executable from being launched if it is specified.
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI_BAK);
}
let updateSettingsIni = processDir.clone();
updateSettingsIni.append(UPDATE_SETTINGS_INI_FILE);
writeFile(updateSettingsIni, UPDATE_SETTINGS_CONTENTS);
@ -192,6 +200,14 @@ function end_test() {
", exception: " + e);
}
let processDir = getAppDir();
// Restore the backup of the updater.ini if it exists
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI_BAK);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI);
}
if (IS_UNIX) {
// This will delete the launch script if it exists.
getLaunchScript();

Просмотреть файл

@ -169,6 +169,14 @@ function run_test() {
gActiveUpdate = gUpdateManager.activeUpdate;
do_check_true(!!gActiveUpdate);
// Backup the updater.ini if it exists by moving it. This prevents the post
// update executable from being launched if it is specified.
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI_BAK);
}
let updateSettingsIni = processDir.clone();
updateSettingsIni.append(UPDATE_SETTINGS_INI_FILE);
writeFile(updateSettingsIni, UPDATE_SETTINGS_CONTENTS);
@ -236,6 +244,14 @@ function end_test() {
resetEnvironment();
let processDir = getAppDir();
// Restore the backup of the updater.ini if it exists
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI_BAK);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI);
}
// Remove the files added by the update.
let updateTestDir = getUpdateTestDir();
try {

Просмотреть файл

@ -168,6 +168,17 @@ function run_test() {
setEnvironment();
// Backup the updater.ini if it exists by moving it. This prevents the post
// update executable from being launched if it is specified.
//XXX disabled until bug 820933 and bug 820934 are fixed
if (0) {
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI_BAK);
}
}
let updateSettingsIni = processDir.clone();
updateSettingsIni.append(UPDATE_SETTINGS_INI_FILE);
writeFile(updateSettingsIni, UPDATE_SETTINGS_CONTENTS);
@ -216,6 +227,14 @@ function end_test() {
resetEnvironment();
let processDir = getAppDir();
// Restore the backup of the updater.ini if it exists
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI_BAK);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI);
}
// Remove the files added by the update.
let updateTestDir = getUpdateTestDir();
try {

Просмотреть файл

@ -170,19 +170,13 @@ function run_test() {
let mar = do_get_file("data/simple.mar");
mar.copyTo(updatesPatchDir, FILE_UPDATE_ARCHIVE);
// Backup the updater.ini
// Backup the updater.ini if it exists by moving it. This prevents the post
// update executable from being launched if it is specified.
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI_BAK);
// Create a new updater.ini to avoid applications that provide a post update
// executable.
let updaterIniContents = "[Strings]\n" +
"Title=Update Test\n" +
"Info=Application Update XPCShell Test - " +
"test_0200_general.js\n";
updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI);
writeFile(updaterIni, updaterIniContents);
}
let updateSettingsIni = processDir.clone();
updateSettingsIni.append(UPDATE_SETTINGS_INI_FILE);
@ -207,6 +201,14 @@ function run_test() {
function end_test() {
resetEnvironment();
let processDir = getAppDir();
// Restore the backup of the updater.ini if it exists
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI_BAK);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI);
}
// Remove the files added by the update.
let updateTestDir = getUpdateTestDir();
try {

Просмотреть файл

@ -176,6 +176,14 @@ function run_test() {
setEnvironment();
// Backup the updater.ini if it exists by moving it. This prevents the post
// update executable from being launched if it is specified.
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI_BAK);
}
let updateSettingsIni = processDir.clone();
updateSettingsIni.append(UPDATE_SETTINGS_INI_FILE);
writeFile(updateSettingsIni, UPDATE_SETTINGS_CONTENTS);
@ -245,6 +253,14 @@ function end_test() {
resetEnvironment();
let processDir = getAppDir();
// Restore the backup of the updater.ini if it exists
let updaterIni = processDir.clone();
updaterIni.append(FILE_UPDATER_INI_BAK);
if (updaterIni.exists()) {
updaterIni.moveTo(processDir, FILE_UPDATER_INI);
}
// Remove the files added by the update.
let updateTestDir = getUpdateTestDir();
try {