From 3fd3de316f655d433138f1dbd4d51bc977ccceeb Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Tue, 16 Jul 2013 19:19:03 -0700 Subject: [PATCH] Part 1. use custom XREExeF and UpdRootD - Bug 889183 - mozapps/update xpcshell tests cannot be run concurrently. r=bbondy --- .../update/test/unit/head_update.js.in | 57 ++++++++++++++++++- .../update/test/unit/test_0010_general.js | 4 ++ .../update/test/unit/test_0020_general.js | 5 ++ .../update/test/unit/test_0030_general.js | 5 ++ .../update/test/unit/test_0040_general.js | 7 ++- .../update/test/unit/test_0050_general.js | 5 ++ .../update/test/unit/test_0060_manager.js | 4 ++ .../update/test/unit/test_0061_manager.js | 4 ++ .../update/test/unit/test_0062_manager.js | 4 ++ .../update/test/unit/test_0063_manager.js | 4 ++ .../update/test/unit/test_0064_manager.js | 4 ++ .../test/unit/test_0070_update_dir_cleanup.js | 4 ++ .../test/unit/test_0071_update_dir_cleanup.js | 4 ++ .../test/unit/test_0072_update_dir_cleanup.js | 4 ++ .../test/unit/test_0073_update_dir_cleanup.js | 4 ++ .../test/unit/test_0080_prompt_silent.js | 4 ++ .../unit/test_0081_prompt_uiAlreadyOpen.js | 4 ++ ...st_0082_prompt_unsupportAlreadyNotified.js | 5 ++ .../update/test/unit/test_0110_general.js | 2 + .../update/test/unit/test_0111_general.js | 2 + .../update/test/unit/test_0112_general.js | 2 + .../update/test/unit/test_0113_general.js | 2 + .../unit/test_0113_versionDowngradeCheck.js | 5 +- .../update/test/unit/test_0114_general.js | 2 + .../unit/test_0114_productChannelCheck.js | 4 +- .../update/test/unit/test_0115_general.js | 2 + ...est_0150_appBinReplaced_xp_win_complete.js | 2 + .../test_0151_appBinPatched_xp_win_partial.js | 2 + ...est_0152_appBinReplaced_xp_win_complete.js | 2 + .../test_0153_appBinPatched_xp_win_partial.js | 2 + .../test/unit/test_0160_appInUse_complete.js | 2 + .../test_0161_appInUse_xp_unix_complete.js | 2 + .../test_0161_appInUse_xp_win_complete.js | 2 + .../test_0162_appInUse_xp_win_complete.js | 2 + .../test_0170_fileLocked_xp_win_complete.js | 2 + .../test_0171_fileLocked_xp_win_partial.js | 2 + .../test_0172_fileLocked_xp_win_complete.js | 2 + .../test_0173_fileLocked_xp_win_partial.js | 2 + .../test_0174_fileLocked_xp_win_complete.js | 2 + .../test_0175_fileLocked_xp_win_partial.js | 2 + .../test_0180_fileInUse_xp_win_complete.js | 2 + .../test_0181_fileInUse_xp_win_partial.js | 2 + ...t_0182_rmrfdirFileInUse_xp_win_complete.js | 2 + ...st_0183_rmrfdirFileInUse_xp_win_partial.js | 2 + .../test_0184_fileInUse_xp_win_complete.js | 2 + .../test_0185_fileInUse_xp_win_partial.js | 2 + ...t_0186_rmrfdirFileInUse_xp_win_complete.js | 2 + ...st_0187_rmrfdirFileInUse_xp_win_partial.js | 2 + .../test_0188_fileInUse_xp_win_complete.js | 2 + .../test_0189_fileInUse_xp_win_partial.js | 2 + ...t_0190_rmrfdirFileInUse_xp_win_complete.js | 2 + ...st_0191_rmrfdirFileInUse_xp_win_partial.js | 2 + .../update/test/unit/test_bug595059.js | 4 ++ .../update/test/unit/test_bug794211.js | 4 ++ .../update/test/unit/test_bug833708.js | 4 ++ 55 files changed, 212 insertions(+), 5 deletions(-) diff --git a/toolkit/mozapps/update/test/unit/head_update.js.in b/toolkit/mozapps/update/test/unit/head_update.js.in index 974afa4fed6f..3e6a072a18b4 100644 --- a/toolkit/mozapps/update/test/unit/head_update.js.in +++ b/toolkit/mozapps/update/test/unit/head_update.js.in @@ -393,7 +393,7 @@ function pathHandler(metadata, response) { * @return The relative path to the directory where the update will be applied. */ function getApplyDirPath() { - return TEST_ID + APPLY_TO_DIR_SUFFIX; + return TEST_ID + APPLY_TO_DIR_SUFFIX + "appdir/"; } /** @@ -1238,7 +1238,7 @@ function cleanupUpdaterTest() { } // Try to remove the updates and the apply to directories. - let applyToDir = getApplyDirFile(null, true); + let applyToDir = getApplyDirFile(null, true).parent; try { removeDirRecursive(applyToDir); } @@ -2160,6 +2160,59 @@ function adjustPathsOnWindows() { let gWindowsBinDir = null; +/** + * This function makes XREExeF and UpdRootD point to unique locations so + * xpcshell tests can run in parallel. + */ +function adjustGeneralPaths() { + let dirProvider = { + getFile: function DP_getFile(prop, persistent) { + persistent.value = true; + if (prop == XRE_EXECUTABLE_FILE) + return do_get_file(getApplyDirPath() + "test" + APP_BIN_SUFFIX, true); + if (prop == XRE_UPDATE_ROOT_DIR) + return do_get_file(getApplyDirPath(), true); + return null; + }, + QueryInterface: function(iid) { + if (iid.equals(AUS_Ci.nsIDirectoryServiceProvider) || + iid.equals(AUS_Ci.nsISupports)) + return this; + throw AUS_Cr.NS_ERROR_NO_INTERFACE; + } + }; + let ds = Services.dirsvc.QueryInterface(AUS_Ci.nsIDirectoryService); + ds.registerProvider(dirProvider); + do_register_cleanup(function() { + ds.unregisterProvider(dirProvider); + let testBin = do_get_file(getApplyDirPath() + "test" + APP_BIN_SUFFIX, true); + // Try to remove the test.bin file if it exists (it shouldn't). + if (testBin.exists()) { + try { + testBin.remove(false); + } + catch (e) { + dump("Unable to remove file\n" + + "path: " + updatesDir.path + "\n" + + "Exception: " + e + "\n"); + } + } + let testDir = do_get_file(getApplyDirPath(), true).parent; + // Try to remove the directory used to apply updates (this is non-fatal + // for the test). + if (testDir.exists()) { + try { + removeDirRecursive(testDir); + } + catch (e) { + dump("Unable to remove directory\n" + + "path: " + updatesDir.path + "\n" + + "Exception: " + e + "\n"); + } + } + }); +} + /** * This function returns the current process directory on Windows and Linux, and * the application bundle directory on Mac. diff --git a/toolkit/mozapps/update/test/unit/test_0010_general.js b/toolkit/mozapps/update/test/unit/test_0010_general.js index 6fc80e199894..03f65f05a7f5 100644 --- a/toolkit/mozapps/update/test/unit/test_0010_general.js +++ b/toolkit/mozapps/update/test/unit/test_0010_general.js @@ -5,10 +5,14 @@ /* General Update Service Tests */ +const TEST_ID = "0010"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + // Verify write access to the custom app dir logTestInfo("testing write access to the application directory"); removeUpdateDirsAndFiles(); diff --git a/toolkit/mozapps/update/test/unit/test_0020_general.js b/toolkit/mozapps/update/test/unit/test_0020_general.js index 7ab3731d7e9d..2439f529c2d1 100644 --- a/toolkit/mozapps/update/test/unit/test_0020_general.js +++ b/toolkit/mozapps/update/test/unit/test_0020_general.js @@ -5,12 +5,17 @@ /* General Update Check Update XML Tests */ +const TEST_ID = "0020"; + var gNextRunFunc; var gExpectedCount; function run_test() { do_test_pending(); do_register_cleanup(end_test); + + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); setUpdateURLOverride(); setUpdateChannel("test_channel"); diff --git a/toolkit/mozapps/update/test/unit/test_0030_general.js b/toolkit/mozapps/update/test/unit/test_0030_general.js index 2ae71bfcbb00..3def9ba607d6 100644 --- a/toolkit/mozapps/update/test/unit/test_0030_general.js +++ b/toolkit/mozapps/update/test/unit/test_0030_general.js @@ -5,6 +5,8 @@ /* General MAR File Download Tests */ +const TEST_ID = "0030"; + const INC_CONTRACT_ID = "@mozilla.org/network/incremental-download;1"; AUS_Cu.import("resource://gre/modules/FileUtils.jsm"); AUS_Cu.import("resource://gre/modules/Services.jsm"); @@ -22,6 +24,9 @@ var gIncrementalDownloadErrorType = 0; function run_test() { do_test_pending(); do_register_cleanup(end_test); + + adjustGeneralPaths(); + Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false); removeUpdateDirsAndFiles(); setUpdateURLOverride(); diff --git a/toolkit/mozapps/update/test/unit/test_0040_general.js b/toolkit/mozapps/update/test/unit/test_0040_general.js index 53c4ed470155..c710f2d43675 100644 --- a/toolkit/mozapps/update/test/unit/test_0040_general.js +++ b/toolkit/mozapps/update/test/unit/test_0040_general.js @@ -3,9 +3,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* General URL Construction Tests */ + Components.utils.import("resource://gre/modules/ctypes.jsm") -/* General URL Construction Tests */ +const TEST_ID = "0040"; const URL_PREFIX = URL_HOST + URL_PATH + "/"; @@ -14,6 +16,9 @@ var gAppInfo; function run_test() { do_test_pending(); do_register_cleanup(end_test); + + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); // The mock XMLHttpRequest is MUCH faster overrideXHR(callHandleEvent); diff --git a/toolkit/mozapps/update/test/unit/test_0050_general.js b/toolkit/mozapps/update/test/unit/test_0050_general.js index 6a16aee7e3cb..a8d474f49a5f 100644 --- a/toolkit/mozapps/update/test/unit/test_0050_general.js +++ b/toolkit/mozapps/update/test/unit/test_0050_general.js @@ -11,6 +11,8 @@ // 2152398868, 2152398878, 2152398890, 2152398919, 2152398920, 2153390069, // 2152398918, 2152398861 +const TEST_ID = "0050"; + var gNextRunFunc; var gExpectedStatusCode; var gExpectedStatusText; @@ -18,6 +20,9 @@ var gExpectedStatusText; function run_test() { do_test_pending(); do_register_cleanup(end_test); + + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); setUpdateURLOverride(); standardInit(); diff --git a/toolkit/mozapps/update/test/unit/test_0060_manager.js b/toolkit/mozapps/update/test/unit/test_0060_manager.js index b99e75643344..ef809a443b12 100644 --- a/toolkit/mozapps/update/test/unit/test_0060_manager.js +++ b/toolkit/mozapps/update/test/unit/test_0060_manager.js @@ -5,10 +5,14 @@ /* General Update Manager Tests */ +const TEST_ID = "0060"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("testing addition of a successful update to " + FILE_UPDATES_DB + " and verification of update properties with the format prior " + "to bug 530872"); diff --git a/toolkit/mozapps/update/test/unit/test_0061_manager.js b/toolkit/mozapps/update/test/unit/test_0061_manager.js index 0fda28478f52..536040a055ce 100644 --- a/toolkit/mozapps/update/test/unit/test_0061_manager.js +++ b/toolkit/mozapps/update/test/unit/test_0061_manager.js @@ -5,10 +5,14 @@ /* General Update Manager Tests */ +const TEST_ID = "0061"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("testing removal of an update download in progress for an " + "older version of the application on startup (bug 485624)"); removeUpdateDirsAndFiles(); diff --git a/toolkit/mozapps/update/test/unit/test_0062_manager.js b/toolkit/mozapps/update/test/unit/test_0062_manager.js index e2a63e1d1055..d5cf4a381fd5 100644 --- a/toolkit/mozapps/update/test/unit/test_0062_manager.js +++ b/toolkit/mozapps/update/test/unit/test_0062_manager.js @@ -5,10 +5,14 @@ /* General Update Manager Tests */ +const TEST_ID = "0062"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("testing resuming an update download in progress for the same " + "version of the application on startup (bug 485624)"); removeUpdateDirsAndFiles(); diff --git a/toolkit/mozapps/update/test/unit/test_0063_manager.js b/toolkit/mozapps/update/test/unit/test_0063_manager.js index 74f5b7963595..e85969629389 100644 --- a/toolkit/mozapps/update/test/unit/test_0063_manager.js +++ b/toolkit/mozapps/update/test/unit/test_0063_manager.js @@ -5,10 +5,14 @@ /* General Update Manager Tests */ +const TEST_ID = "0063"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("testing removing an active update for a channel that is not" + "valid due to switching channels (bug 486275)"); removeUpdateDirsAndFiles(); diff --git a/toolkit/mozapps/update/test/unit/test_0064_manager.js b/toolkit/mozapps/update/test/unit/test_0064_manager.js index d66160c42121..22012ec8c698 100644 --- a/toolkit/mozapps/update/test/unit/test_0064_manager.js +++ b/toolkit/mozapps/update/test/unit/test_0064_manager.js @@ -5,10 +5,14 @@ /* General Update Manager Tests */ +const TEST_ID = "0064"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("testing removal of an update download in progress for the " + "same version of the application with the same application " + "build id on startup (bug 536547)"); diff --git a/toolkit/mozapps/update/test/unit/test_0070_update_dir_cleanup.js b/toolkit/mozapps/update/test/unit/test_0070_update_dir_cleanup.js index 5d6a42cb0d67..843bcd6abe60 100644 --- a/toolkit/mozapps/update/test/unit/test_0070_update_dir_cleanup.js +++ b/toolkit/mozapps/update/test/unit/test_0070_update_dir_cleanup.js @@ -5,10 +5,14 @@ /* General Update Directory Cleanup Tests */ +const TEST_ID = "0070"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false); diff --git a/toolkit/mozapps/update/test/unit/test_0071_update_dir_cleanup.js b/toolkit/mozapps/update/test/unit/test_0071_update_dir_cleanup.js index 8fd0382d5d57..3b665111b6fa 100644 --- a/toolkit/mozapps/update/test/unit/test_0071_update_dir_cleanup.js +++ b/toolkit/mozapps/update/test/unit/test_0071_update_dir_cleanup.js @@ -5,10 +5,14 @@ /* General Update Directory Cleanup Tests */ +const TEST_ID = "0071"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false); diff --git a/toolkit/mozapps/update/test/unit/test_0072_update_dir_cleanup.js b/toolkit/mozapps/update/test/unit/test_0072_update_dir_cleanup.js index d75d7fc29239..43ce7eaf06a1 100644 --- a/toolkit/mozapps/update/test/unit/test_0072_update_dir_cleanup.js +++ b/toolkit/mozapps/update/test/unit/test_0072_update_dir_cleanup.js @@ -4,10 +4,14 @@ /* General Update Directory Cleanup Tests - Bug 539717 */ +const TEST_ID = "0072"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false); diff --git a/toolkit/mozapps/update/test/unit/test_0073_update_dir_cleanup.js b/toolkit/mozapps/update/test/unit/test_0073_update_dir_cleanup.js index 9e5b18674556..286dd2345259 100644 --- a/toolkit/mozapps/update/test/unit/test_0073_update_dir_cleanup.js +++ b/toolkit/mozapps/update/test/unit/test_0073_update_dir_cleanup.js @@ -4,10 +4,14 @@ /* General Update Directory Cleanup Tests - Bug 601701 */ +const TEST_ID = "0073"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false); diff --git a/toolkit/mozapps/update/test/unit/test_0080_prompt_silent.js b/toolkit/mozapps/update/test/unit/test_0080_prompt_silent.js index 4a5a24376070..8dd9b4f77fa7 100644 --- a/toolkit/mozapps/update/test/unit/test_0080_prompt_silent.js +++ b/toolkit/mozapps/update/test/unit/test_0080_prompt_silent.js @@ -8,10 +8,14 @@ * preference is true. */ +const TEST_ID = "0080"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("testing nsIUpdatePrompt notifications should not be seen " + "when the " + PREF_APP_UPDATE_SILENT + " preference is true"); diff --git a/toolkit/mozapps/update/test/unit/test_0081_prompt_uiAlreadyOpen.js b/toolkit/mozapps/update/test/unit/test_0081_prompt_uiAlreadyOpen.js index 6240c51c3120..99066c85cd58 100644 --- a/toolkit/mozapps/update/test/unit/test_0081_prompt_uiAlreadyOpen.js +++ b/toolkit/mozapps/update/test/unit/test_0081_prompt_uiAlreadyOpen.js @@ -7,10 +7,14 @@ * showUpdateAvailable when there is already an application update window open. */ +const TEST_ID = "0081"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("testing nsIUpdatePrompt notifications should not be seen when " + "there is already an application update window open"); diff --git a/toolkit/mozapps/update/test/unit/test_0082_prompt_unsupportAlreadyNotified.js b/toolkit/mozapps/update/test/unit/test_0082_prompt_unsupportAlreadyNotified.js index 6286b2a41732..a050fb665de5 100644 --- a/toolkit/mozapps/update/test/unit/test_0082_prompt_unsupportAlreadyNotified.js +++ b/toolkit/mozapps/update/test/unit/test_0082_prompt_unsupportAlreadyNotified.js @@ -7,9 +7,14 @@ * unsupported system update when it has already been shown (bug 843497). */ +const TEST_ID = "0082"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); setUpdateURLOverride(); // The mock XMLHttpRequest is MUCH faster diff --git a/toolkit/mozapps/update/test/unit/test_0110_general.js b/toolkit/mozapps/update/test/unit/test_0110_general.js index c680abf6b508..aee93135c1a6 100644 --- a/toolkit/mozapps/update/test/unit/test_0110_general.js +++ b/toolkit/mozapps/update/test/unit/test_0110_general.js @@ -238,6 +238,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_COMPLETE_FILE); let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX); diff --git a/toolkit/mozapps/update/test/unit/test_0111_general.js b/toolkit/mozapps/update/test/unit/test_0111_general.js index bd03e6665de6..859f4402eb2d 100644 --- a/toolkit/mozapps/update/test/unit/test_0111_general.js +++ b/toolkit/mozapps/update/test/unit/test_0111_general.js @@ -240,6 +240,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_PARTIAL_FILE); let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX); diff --git a/toolkit/mozapps/update/test/unit/test_0112_general.js b/toolkit/mozapps/update/test/unit/test_0112_general.js index ec8d60e53803..9eecf5060fca 100644 --- a/toolkit/mozapps/update/test/unit/test_0112_general.js +++ b/toolkit/mozapps/update/test/unit/test_0112_general.js @@ -233,6 +233,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_PARTIAL_FILE); let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX); diff --git a/toolkit/mozapps/update/test/unit/test_0113_general.js b/toolkit/mozapps/update/test/unit/test_0113_general.js index 5f2e22f59be1..7ba89a39069e 100644 --- a/toolkit/mozapps/update/test/unit/test_0113_general.js +++ b/toolkit/mozapps/update/test/unit/test_0113_general.js @@ -271,6 +271,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js b/toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js index 3c5614e9e332..8a2c2b32aa39 100644 --- a/toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js +++ b/toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js @@ -5,7 +5,7 @@ /* Test version downgrade MAR security check */ -const TEST_ID = "0113"; +const TEST_ID = "0113-VDC"; // We don't actually care if the MAR has any data, we only care about the // application return code and update.status result. @@ -20,6 +20,9 @@ function run_test() { // Setup an old version MAR file do_register_cleanup(cleanupUpdaterTest); + + adjustGeneralPaths(); + setupUpdaterTest(MAR_OLD_VERSION_FILE); // Apply the MAR diff --git a/toolkit/mozapps/update/test/unit/test_0114_general.js b/toolkit/mozapps/update/test/unit/test_0114_general.js index bd7af36f3345..c23c92f696b9 100644 --- a/toolkit/mozapps/update/test/unit/test_0114_general.js +++ b/toolkit/mozapps/update/test/unit/test_0114_general.js @@ -240,6 +240,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_PARTIAL_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js b/toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js index 721e163c7d7e..5b1ce06e3a6e 100644 --- a/toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js +++ b/toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js @@ -5,7 +5,7 @@ /* Test product/channel MAR security check */ -const TEST_ID = "0114"; +const TEST_ID = "0114-PCC"; // We don't actually care if the MAR has any data, we only care about the // application return code and update.status result. @@ -18,6 +18,8 @@ function run_test() { return; } + adjustGeneralPaths(); + // Setup a wrong channel MAR file do_register_cleanup(cleanupUpdaterTest); setupUpdaterTest(MAR_WRONG_CHANNEL_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0115_general.js b/toolkit/mozapps/update/test/unit/test_0115_general.js index 4173684aac1e..f64957753fed 100644 --- a/toolkit/mozapps/update/test/unit/test_0115_general.js +++ b/toolkit/mozapps/update/test/unit/test_0115_general.js @@ -232,6 +232,8 @@ ADDITIONAL_TEST_DIRS = [ function run_test() { do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_PARTIAL_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0150_appBinReplaced_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0150_appBinReplaced_xp_win_complete.js index 5fc25de43ff1..afa1462b1590 100644 --- a/toolkit/mozapps/update/test/unit/test_0150_appBinReplaced_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0150_appBinReplaced_xp_win_complete.js @@ -194,6 +194,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_COMPLETE_WIN_FILE); gCallbackBinFile = "exe0.exe"; diff --git a/toolkit/mozapps/update/test/unit/test_0151_appBinPatched_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0151_appBinPatched_xp_win_partial.js index eb8de17fd185..5339187a3fc5 100644 --- a/toolkit/mozapps/update/test/unit/test_0151_appBinPatched_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0151_appBinPatched_xp_win_partial.js @@ -196,6 +196,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_IN_USE_WIN_FILE); gCallbackBinFile = "exe0.exe"; diff --git a/toolkit/mozapps/update/test/unit/test_0152_appBinReplaced_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0152_appBinReplaced_xp_win_complete.js index abf7f32fec57..58f751a32274 100644 --- a/toolkit/mozapps/update/test/unit/test_0152_appBinReplaced_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0152_appBinReplaced_xp_win_complete.js @@ -194,6 +194,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_WIN_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0153_appBinPatched_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0153_appBinPatched_xp_win_partial.js index 3106e3d8e524..3fac65494ba5 100644 --- a/toolkit/mozapps/update/test/unit/test_0153_appBinPatched_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0153_appBinPatched_xp_win_partial.js @@ -196,6 +196,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_IN_USE_WIN_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js b/toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js index e3bf0427d370..c559989c933f 100644 --- a/toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js @@ -237,6 +237,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_COMPLETE_FILE); // Launch the callback helper application so it is in use during the update diff --git a/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_unix_complete.js b/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_unix_complete.js index aa9f0334c26e..68d5bdc74787 100644 --- a/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_unix_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_unix_complete.js @@ -237,6 +237,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_win_complete.js index 2a0ed82e65e5..f426aaa6e4b5 100644 --- a/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_win_complete.js @@ -187,6 +187,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0162_appInUse_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0162_appInUse_xp_win_complete.js index a99131e3930d..8508c63b1be5 100644 --- a/toolkit/mozapps/update/test/unit/test_0162_appInUse_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0162_appInUse_xp_win_complete.js @@ -187,6 +187,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js index 532d4e28bd6b..6e0567242eda 100644 --- a/toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js @@ -187,6 +187,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_COMPLETE_FILE); // Exclusively lock an existing file so it is in use during the update diff --git a/toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js index 4810ac2a54a4..0cbacdb779c8 100644 --- a/toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js @@ -188,6 +188,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_PARTIAL_FILE); // Exclusively lock an existing file so it is in use during the update diff --git a/toolkit/mozapps/update/test/unit/test_0172_fileLocked_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0172_fileLocked_xp_win_complete.js index 012c10a8dd4c..0baa3f7a5b2b 100644 --- a/toolkit/mozapps/update/test/unit/test_0172_fileLocked_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0172_fileLocked_xp_win_complete.js @@ -187,6 +187,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0173_fileLocked_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0173_fileLocked_xp_win_partial.js index fb3f5c802cb8..53eed9e46fbb 100644 --- a/toolkit/mozapps/update/test/unit/test_0173_fileLocked_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0173_fileLocked_xp_win_partial.js @@ -188,6 +188,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_PARTIAL_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0174_fileLocked_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0174_fileLocked_xp_win_complete.js index 52fbee575254..18e15faf126d 100644 --- a/toolkit/mozapps/update/test/unit/test_0174_fileLocked_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0174_fileLocked_xp_win_complete.js @@ -187,6 +187,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0175_fileLocked_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0175_fileLocked_xp_win_partial.js index 9ce260ba882e..55ae24b86540 100644 --- a/toolkit/mozapps/update/test/unit/test_0175_fileLocked_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0175_fileLocked_xp_win_partial.js @@ -188,6 +188,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_PARTIAL_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js index 1716f3fb469d..baca04c313b8 100644 --- a/toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js @@ -193,6 +193,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_COMPLETE_FILE); // Launch an existing file so it is in use during the update diff --git a/toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js index 915dd0e811c2..e2adcdf51623 100644 --- a/toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js @@ -196,6 +196,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_IN_USE_WIN_FILE); // Launch an existing file so it is in use during the update diff --git a/toolkit/mozapps/update/test/unit/test_0182_rmrfdirFileInUse_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0182_rmrfdirFileInUse_xp_win_complete.js index 14a4ff185ce4..f954cf8fa945 100644 --- a/toolkit/mozapps/update/test/unit/test_0182_rmrfdirFileInUse_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0182_rmrfdirFileInUse_xp_win_complete.js @@ -193,6 +193,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_COMPLETE_FILE); let fileInUseBin = getApplyDirFile(TEST_DIRS[4].relPathDir + diff --git a/toolkit/mozapps/update/test/unit/test_0183_rmrfdirFileInUse_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0183_rmrfdirFileInUse_xp_win_partial.js index 9920fcb89a76..89cec8b25fc9 100644 --- a/toolkit/mozapps/update/test/unit/test_0183_rmrfdirFileInUse_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0183_rmrfdirFileInUse_xp_win_partial.js @@ -236,6 +236,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + setupUpdaterTest(MAR_IN_USE_WIN_FILE); let fileInUseBin = getApplyDirFile(TEST_DIRS[2].relPathDir + diff --git a/toolkit/mozapps/update/test/unit/test_0184_fileInUse_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0184_fileInUse_xp_win_complete.js index 00843ea346ac..15560d322646 100644 --- a/toolkit/mozapps/update/test/unit/test_0184_fileInUse_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0184_fileInUse_xp_win_complete.js @@ -193,6 +193,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0185_fileInUse_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0185_fileInUse_xp_win_partial.js index a57e46d95110..f16e6cf72801 100644 --- a/toolkit/mozapps/update/test/unit/test_0185_fileInUse_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0185_fileInUse_xp_win_partial.js @@ -196,6 +196,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_IN_USE_WIN_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0186_rmrfdirFileInUse_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0186_rmrfdirFileInUse_xp_win_complete.js index 93d82111627a..09df701c54f6 100644 --- a/toolkit/mozapps/update/test/unit/test_0186_rmrfdirFileInUse_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0186_rmrfdirFileInUse_xp_win_complete.js @@ -193,6 +193,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0187_rmrfdirFileInUse_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0187_rmrfdirFileInUse_xp_win_partial.js index 7421c544db1d..ac73b6aa26f1 100644 --- a/toolkit/mozapps/update/test/unit/test_0187_rmrfdirFileInUse_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0187_rmrfdirFileInUse_xp_win_partial.js @@ -236,6 +236,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_IN_USE_WIN_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0188_fileInUse_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0188_fileInUse_xp_win_complete.js index 0e99a52374ab..a443d5af1c08 100644 --- a/toolkit/mozapps/update/test/unit/test_0188_fileInUse_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0188_fileInUse_xp_win_complete.js @@ -193,6 +193,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0189_fileInUse_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0189_fileInUse_xp_win_partial.js index da4cde63096b..c715129f20b3 100644 --- a/toolkit/mozapps/update/test/unit/test_0189_fileInUse_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0189_fileInUse_xp_win_partial.js @@ -196,6 +196,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_IN_USE_WIN_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0190_rmrfdirFileInUse_xp_win_complete.js b/toolkit/mozapps/update/test/unit/test_0190_rmrfdirFileInUse_xp_win_complete.js index 58ee08057895..6fa9b8acccd8 100644 --- a/toolkit/mozapps/update/test/unit/test_0190_rmrfdirFileInUse_xp_win_complete.js +++ b/toolkit/mozapps/update/test/unit/test_0190_rmrfdirFileInUse_xp_win_complete.js @@ -193,6 +193,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_COMPLETE_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_0191_rmrfdirFileInUse_xp_win_partial.js b/toolkit/mozapps/update/test/unit/test_0191_rmrfdirFileInUse_xp_win_partial.js index 8ae0bd386361..7546060fd7d8 100644 --- a/toolkit/mozapps/update/test/unit/test_0191_rmrfdirFileInUse_xp_win_partial.js +++ b/toolkit/mozapps/update/test/unit/test_0191_rmrfdirFileInUse_xp_win_partial.js @@ -236,6 +236,8 @@ function run_test() { do_test_pending(); do_register_cleanup(cleanupUpdaterTest); + adjustGeneralPaths(); + gBackgroundUpdate = true; setupUpdaterTest(MAR_IN_USE_WIN_FILE); diff --git a/toolkit/mozapps/update/test/unit/test_bug595059.js b/toolkit/mozapps/update/test/unit/test_bug595059.js index 1e73a976148d..772ec1421c77 100644 --- a/toolkit/mozapps/update/test/unit/test_bug595059.js +++ b/toolkit/mozapps/update/test/unit/test_bug595059.js @@ -7,10 +7,14 @@ * partial update. */ +const TEST_ID = "bug595059"; + function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("testing Bug 595059 - calling nsIUpdatePrompt::showUpdateError " + "should call getNewPrompter and alert on the object returned " + "by getNewPrompter when the update.state = " + STATE_FAILED + diff --git a/toolkit/mozapps/update/test/unit/test_bug794211.js b/toolkit/mozapps/update/test/unit/test_bug794211.js index 2016c6eee80e..d023ec209027 100644 --- a/toolkit/mozapps/update/test/unit/test_bug794211.js +++ b/toolkit/mozapps/update/test/unit/test_bug794211.js @@ -5,6 +5,8 @@ /* Offline retry test (Bug 794211) */ +const TEST_ID = "bug794211"; + // Needs to be in sync w/ nsUpdateService.js const NETWORK_ERROR_OFFLINE = 111; @@ -12,6 +14,8 @@ function run_test() { do_test_pending(); do_register_cleanup(end_test); + adjustGeneralPaths(); + logTestInfo("test when an update check fails because the network is " + "offline that we check again when the network comes online. " + "(Bug 794211)"); diff --git a/toolkit/mozapps/update/test/unit/test_bug833708.js b/toolkit/mozapps/update/test/unit/test_bug833708.js index aa89f8db42c7..67116068bedd 100644 --- a/toolkit/mozapps/update/test/unit/test_bug833708.js +++ b/toolkit/mozapps/update/test/unit/test_bug833708.js @@ -4,6 +4,8 @@ */ AUS_Cu.import("resource://gre/modules/FileUtils.jsm"); + +const TEST_ID = "bug794211"; const KEY_UPDATE_ARCHIVE_DIR = "UpdArchD" let gActiveUpdate = null; @@ -28,6 +30,8 @@ function run_test() { do_register_cleanup(end_test); DEBUG_AUS_TEST = true; + adjustGeneralPaths(); + removeUpdateDirsAndFiles(); setUpdateURLOverride(); overrideXHR(xhr_pt1);