Bug 668508 - Use xpcshell manifests instead of preprocessing to control which update tests run on which platforms, r=rs
authorPhil Ringnalda <philringnalda@gmail.com>
Wed, 08 Jun 2011 23:18:44 -0700
changeset 73973 9df2094c115ff39d6033418c6facab48e1371d06
parent 73972 9ab31534ef50c1698345bf4239b6667b68baab70
child 73974 4c89811f38ce3fc1fe1f64c39ac9eedb29bb30f3
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersrs
bugs668508
milestone8.0a1
Bug 668508 - Use xpcshell manifests instead of preprocessing to control which update tests run on which platforms, r=rs
toolkit/mozapps/update/test/unit/test_0110_general.js
toolkit/mozapps/update/test/unit/test_0111_general.js
toolkit/mozapps/update/test/unit/test_0112_general.js
toolkit/mozapps/update/test/unit/test_0120_channelChange_complete.js
toolkit/mozapps/update/test/unit/test_0150_appBinReplaced_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0151_appBinPatched_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0182_rmrfdirFileInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0183_rmrfdirFileInUse_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js
toolkit/mozapps/update/test/unit/xpcshell.ini
toolkit/mozapps/update/test/unit/xpcshell_updater.ini
toolkit/mozapps/update/test/unit/xpcshell_updater_windows.ini
toolkit/mozapps/update/test/unit/xpcshell_updater_xp_unix.ini
--- a/toolkit/mozapps/update/test/unit/test_0110_general.js
+++ b/toolkit/mozapps/update/test/unit/test_0110_general.js
@@ -264,21 +264,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (IS_ANDROID) {
-    logTestInfo("this test is not applicable to Android... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_FILE);
 
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
   let applyToDir = getApplyDirFile();
 
--- a/toolkit/mozapps/update/test/unit/test_0111_general.js
+++ b/toolkit/mozapps/update/test/unit/test_0111_general.js
@@ -266,21 +266,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (IS_ANDROID) {
-    logTestInfo("this test is not applicable to Android... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_PARTIAL_FILE);
 
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
   let applyToDir = getApplyDirFile();
 
--- a/toolkit/mozapps/update/test/unit/test_0112_general.js
+++ b/toolkit/mozapps/update/test/unit/test_0112_general.js
@@ -259,21 +259,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  if (IS_ANDROID) {
-    logTestInfo("this test is not applicable to Android... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_PARTIAL_FILE);
 
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
   let applyToDir = getApplyDirFile();
 
--- a/toolkit/mozapps/update/test/unit/test_0120_channelChange_complete.js
+++ b/toolkit/mozapps/update/test/unit/test_0120_channelChange_complete.js
@@ -227,21 +227,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (IS_ANDROID) {
-    logTestInfo("this test is not applicable to Android... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_FILE);
 
   let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
   let applyToDir = getApplyDirFile();
 
--- 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
@@ -187,21 +187,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_WIN_FILE);
 
   gCallbackBinFile = "exe0.exe";
 
   // apply the complete mar
--- 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
@@ -189,21 +189,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_IN_USE_WIN_FILE);
 
   gCallbackBinFile = "exe0.exe";
 
   // apply the complete mar
--- a/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
+++ b/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_unix_complete.js
@@ -230,22 +230,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (!IS_UNIX || IS_ANDROID) {
-    logTestInfo("this test is only applicable to XP_UNIX platforms except " +
-                "for Android... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_FILE);
 
   // Launch the callback helper application so it is in use during the update
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
   callbackApp.permissions = PERMS_DIRECTORY;
--- a/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete.js
+++ b/toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete.js
@@ -180,21 +180,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_FILE);
 
   // Launch the callback helper application so it is in use during the update
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
--- 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
@@ -180,21 +180,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_FILE);
 
   // Exclusively lock an existing file so it is in use during the update
   let helperBin = do_get_file(HELPER_BIN_FILE);
   let helperDestDir = getApplyDirFile("a/b/");
--- 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
@@ -181,21 +181,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_PARTIAL_FILE);
 
   // Exclusively lock an existing file so it is in use during the update
   let helperBin = do_get_file(HELPER_BIN_FILE);
   let helperDestDir = getApplyDirFile("a/b/");
--- 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
@@ -186,21 +186,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_FILE);
 
   // Launch an existing file so it is in use during the update
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
--- 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
@@ -189,21 +189,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_IN_USE_WIN_FILE);
 
   // Launch an existing file so it is in use during the update
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
--- 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
@@ -186,21 +186,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_COMPLETE_FILE);
 
   let fileInUseBin = getApplyDirFile(TEST_DIRS[4].relPathDir +
                                      TEST_DIRS[4].subDirs[0] +
                                      TEST_DIRS[4].subDirFiles[0]);
--- 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
@@ -229,21 +229,16 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  if (!IS_WIN) {
-    logTestInfo("this test is only applicable to Windows... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(cleanupUpdaterTest);
 
   setupUpdaterTest(MAR_IN_USE_WIN_FILE);
 
   let fileInUseBin = getApplyDirFile(TEST_DIRS[2].relPathDir +
                                      TEST_DIRS[2].files[0]);
   // Remove the empty file created for the test so the helper application can
--- a/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js
@@ -102,21 +102,16 @@ XPCOMUtils.defineLazyGetter(this, "gAppB
       appBinPath = '"' + appBinPath + '"';
     }
     return appBinPath;
   }
   return null;
 });
 
 function run_test() {
-  if (IS_ANDROID) {
-    logTestInfo("this test is not applicable to Android... returning early");
-    return;
-  }
-
   do_test_pending();
   do_register_cleanup(end_test);
 
   removeUpdateDirsAndFiles();
 
   if (!gAppBinPath) {
     do_throw("Main application binary not found... expected: " +
              APP_BIN_NAME + APP_BIN_SUFFIX);
--- a/toolkit/mozapps/update/test/unit/xpcshell.ini
+++ b/toolkit/mozapps/update/test/unit/xpcshell.ini
@@ -13,25 +13,18 @@ tail =
 [test_0063_manager.js]
 [test_0064_manager.js]
 [test_0070_update_dir_cleanup.js]
 [test_0071_update_dir_cleanup.js]
 [test_0072_update_dir_cleanup.js]
 [test_0073_update_dir_cleanup.js]
 [test_0080_prompt_silent.js]
 [test_0081_prompt_uiAlreadyOpen.js]
-[test_0110_general.js]
-[test_0111_general.js]
-[test_0112_general.js]
-[test_0120_channelChange_complete.js]
-[test_0150_appBinReplaced_xp_win_complete.js]
-[test_0151_appBinPatched_xp_win_partial.js]
-[test_0160_appInUse_xp_unix_complete.js]
-[test_0160_appInUse_xp_win_complete.js]
-[test_0170_fileLocked_xp_win_complete.js]
-[test_0171_fileLocked_xp_win_partial.js]
-[test_0180_fileInUse_xp_win_complete.js]
-[test_0181_fileInUse_xp_win_partial.js]
-[test_0182_rmrfdirFileInUse_xp_win_complete.js]
-[test_0183_rmrfdirFileInUse_xp_win_partial.js]
-[test_0200_app_launch_apply_update.js]
+; Tests that require the updater binary
+[include:xpcshell_updater.ini]
+skip-if = os == 'android'
+; Platform-specific updater tests
+[include:xpcshell_updater_windows.ini]
+run-if = os == 'win'
+[include:xpcshell_updater_xp_unix.ini]
+run-if = os == 'linux' || os == 'mac'
 [test_bug497578.js]
 [test_bug595059.js]
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/test/unit/xpcshell_updater.ini
@@ -0,0 +1,5 @@
+[test_0110_general.js]
+[test_0111_general.js]
+[test_0112_general.js]
+[test_0120_channelChange_complete.js]
+[test_0200_app_launch_apply_update.js]
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/test/unit/xpcshell_updater_windows.ini
@@ -0,0 +1,9 @@
+[test_0150_appBinReplaced_xp_win_complete.js]
+[test_0151_appBinPatched_xp_win_partial.js]
+[test_0160_appInUse_xp_win_complete.js]
+[test_0170_fileLocked_xp_win_complete.js]
+[test_0171_fileLocked_xp_win_partial.js]
+[test_0180_fileInUse_xp_win_complete.js]
+[test_0181_fileInUse_xp_win_partial.js]
+[test_0182_rmrfdirFileInUse_xp_win_complete.js]
+[test_0183_rmrfdirFileInUse_xp_win_partial.js]
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/update/test/unit/xpcshell_updater_xp_unix.ini
@@ -0,0 +1,1 @@
+[test_0160_appInUse_xp_unix_complete.js]