Merge f-t to m-c
authorPhil Ringnalda <philringnalda@gmail.com>
Sat, 26 Oct 2013 11:17:15 -0700
changeset 167098 c41239469e316686d7407f07be02a9feb499a73c
parent 167093 f63b098e8ac72a9949c05833e47e94d153e4c7f8 (current diff)
parent 167097 60c2fea83c0f7979db6460a1f860a8b6fc863c91 (diff)
child 167100 6baab9dc96df2407dbff5ede6e1d03cc64d0362a
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge f-t to m-c
toolkit/mozapps/update/test/Makefile.in
toolkit/mozapps/update/test/TestAUSHelper.cpp
toolkit/mozapps/update/test/TestAUSReadStrings.cpp
toolkit/mozapps/update/test/TestAUSReadStrings1.ini
toolkit/mozapps/update/test/TestAUSReadStrings2.ini
toolkit/mozapps/update/test/TestAUSReadStrings3.ini
toolkit/mozapps/update/test/chrome/Makefile.in
toolkit/mozapps/update/test/chrome/chrome.ini
toolkit/mozapps/update/test/chrome/moz.build
toolkit/mozapps/update/test/chrome/test_0011_check_basic.xul
toolkit/mozapps/update/test/chrome/test_0012_check_basic_license.xul
toolkit/mozapps/update/test/chrome/test_0013_check_incompat_basic.xul
toolkit/mozapps/update/test/chrome/test_0014_check_incompat_basic_license.xul
toolkit/mozapps/update/test/chrome/test_0015_check_incompat_basic_addons.xul
toolkit/mozapps/update/test/chrome/test_0016_check_incompat_basic_license_addons.xul
toolkit/mozapps/update/test/chrome/test_0017_check_staging_basic.xul
toolkit/mozapps/update/test/chrome/test_0021_check_billboard.xul
toolkit/mozapps/update/test/chrome/test_0022_check_billboard_license.xul
toolkit/mozapps/update/test/chrome/test_0023_check_incompat_billboard.xul
toolkit/mozapps/update/test/chrome/test_0024_check_incompat_billboard_license.xul
toolkit/mozapps/update/test/chrome/test_0025_check_incompat_billboard_addons.xul
toolkit/mozapps/update/test/chrome/test_0026_check_incompat_billboard_license_addons.xul
toolkit/mozapps/update/test/chrome/test_0031_available_basic.xul
toolkit/mozapps/update/test/chrome/test_0032_available_basic_license.xul
toolkit/mozapps/update/test/chrome/test_0033_available_incompat_basic.xul
toolkit/mozapps/update/test/chrome/test_0034_available_incompat_basic_license.xul
toolkit/mozapps/update/test/chrome/test_0035_available_incompat_basic_addons.xul
toolkit/mozapps/update/test/chrome/test_0036_available_incompat_basic_license_addons.xul
toolkit/mozapps/update/test/chrome/test_0041_available_billboard.xul
toolkit/mozapps/update/test/chrome/test_0042_available_billboard_license.xul
toolkit/mozapps/update/test/chrome/test_0043_available_incompat_billboard.xul
toolkit/mozapps/update/test/chrome/test_0044_available_incompat_billboard_license.xul
toolkit/mozapps/update/test/chrome/test_0045_available_incompat_billboard_addons.xul
toolkit/mozapps/update/test/chrome/test_0046_available_incompat_billboard_license_addons.xul
toolkit/mozapps/update/test/chrome/test_0051_check_error_xml_malformed.xul
toolkit/mozapps/update/test/chrome/test_0052_check_no_updates.xul
toolkit/mozapps/update/test/chrome/test_0053_check_billboard_license_noAttr.xul
toolkit/mozapps/update/test/chrome/test_0054_check_billboard_license_404.xul
toolkit/mozapps/update/test/chrome/test_0061_check_verifyFailPartial_noComplete.xul
toolkit/mozapps/update/test/chrome/test_0062_check_verifyFailComplete_noPartial.xul
toolkit/mozapps/update/test/chrome/test_0063_check_verifyFailPartialComplete.xul
toolkit/mozapps/update/test/chrome/test_0064_check_verifyFailPartial_successComplete.xul
toolkit/mozapps/update/test/chrome/test_0071_notify_verifyFailPartial_noComplete.xul
toolkit/mozapps/update/test/chrome/test_0072_notify_verifyFailComplete_noPartial.xul
toolkit/mozapps/update/test/chrome/test_0073_notify_verifyFailPartialComplete.xul
toolkit/mozapps/update/test/chrome/test_0074_notify_verifyFailPartial_successComplete.xul
toolkit/mozapps/update/test/chrome/test_0081_error_patchApplyFailure_partial_only.xul
toolkit/mozapps/update/test/chrome/test_0082_error_patchApplyFailure_complete_only.xul
toolkit/mozapps/update/test/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
toolkit/mozapps/update/test/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
toolkit/mozapps/update/test/chrome/test_0091_installed.xul
toolkit/mozapps/update/test/chrome/test_0092_finishedBackground.xul
toolkit/mozapps/update/test/chrome/test_0093_restartNotification.xul
toolkit/mozapps/update/test/chrome/test_0094_restartNotification_remote.xul
toolkit/mozapps/update/test/chrome/test_0095_restartNotification_remoteInvalidNumber.xul
toolkit/mozapps/update/test/chrome/test_0096_restartNotification_stagedBackground.xul
toolkit/mozapps/update/test/chrome/test_0097_restartNotification_stagedServiceBackground.xul
toolkit/mozapps/update/test/chrome/test_0101_background_restartNotification.xul
toolkit/mozapps/update/test/chrome/test_0102_background_restartNotification_staging.xul
toolkit/mozapps/update/test/chrome/test_0103_background_restartNotification_stagingService.xul
toolkit/mozapps/update/test/chrome/test_0111_neverButton_basic.xul
toolkit/mozapps/update/test/chrome/test_0112_neverButton_billboard.xul
toolkit/mozapps/update/test/chrome/test_0113_showNeverForVersionRemovedWithPref.xul
toolkit/mozapps/update/test/chrome/test_0121_check_requireBuiltinCert.xul
toolkit/mozapps/update/test/chrome/test_0122_check_allowNonBuiltinCert_validCertAttrs.xul
toolkit/mozapps/update/test/chrome/test_0123_check_allowNonBuiltinCert_noCertAttrsCheck.xul
toolkit/mozapps/update/test/chrome/test_0131_check_invalidCertAttrs_noUpdate.xul
toolkit/mozapps/update/test/chrome/test_0132_check_invalidCertAttrs_hasUpdate.xul
toolkit/mozapps/update/test/chrome/test_0141_notify_invalidCertAttrs_noUpdate.xul
toolkit/mozapps/update/test/chrome/test_0142_notify_invalidCertAttrs_hasUpdate.xul
toolkit/mozapps/update/test/chrome/test_0151_notify_backgroundCheckError.xul
toolkit/mozapps/update/test/chrome/test_0161_check_unsupported.xul
toolkit/mozapps/update/test/chrome/test_0162_notify_unsupported.xul
toolkit/mozapps/update/test/chrome/test_0900_deprecatedUpdateFormat_minor.xul
toolkit/mozapps/update/test/chrome/test_0901_deprecatedUpdateFormat_major.xul
toolkit/mozapps/update/test/chrome/test_9999_cleanup.xul
toolkit/mozapps/update/test/chrome/update.sjs
toolkit/mozapps/update/test/chrome/utils.js
toolkit/mozapps/update/test/marionette/data/bad.xml
toolkit/mozapps/update/test/marionette/data/err.cgi
toolkit/mozapps/update/test/marionette/update-smoketests.ini
toolkit/mozapps/update/test/marionette/update-tests.ini
toolkit/mozapps/update/test/marionette/update_smoketest_ota_same_version.js
toolkit/mozapps/update/test/marionette/update_smoketest_ota_same_version.py
toolkit/mozapps/update/test/marionette/update_smoketest_ota_simple.js
toolkit/mozapps/update/test/marionette/update_smoketest_ota_simple.py
toolkit/mozapps/update/test/marionette/update_test_ota_simple.js
toolkit/mozapps/update/test/marionette/update_test_ota_simple.py
toolkit/mozapps/update/test/marionette/update_test_status.js
toolkit/mozapps/update/test/marionette/update_test_status.py
toolkit/mozapps/update/test/moz.build
toolkit/mozapps/update/test/shared.js
toolkit/mozapps/update/test/sharedUpdateXML.js
toolkit/mozapps/update/test/unit/data/complete.mar
toolkit/mozapps/update/test/unit/data/complete.png
toolkit/mozapps/update/test/unit/data/complete_cc_log_switch_success
toolkit/mozapps/update/test/unit/data/complete_log_success
toolkit/mozapps/update/test/unit/data/complete_log_switch_success
toolkit/mozapps/update/test/unit/data/complete_precomplete
toolkit/mozapps/update/test/unit/data/complete_removed-files
toolkit/mozapps/update/test/unit/data/complete_update_manifest
toolkit/mozapps/update/test/unit/data/complete_win.mar
toolkit/mozapps/update/test/unit/data/old_version_mar.mar
toolkit/mozapps/update/test/unit/data/partial.mar
toolkit/mozapps/update/test/unit/data/partial.png
toolkit/mozapps/update/test/unit/data/partial_in_use_win_after.exe
toolkit/mozapps/update/test/unit/data/partial_in_use_win_before.exe
toolkit/mozapps/update/test/unit/data/partial_log_failure
toolkit/mozapps/update/test/unit/data/partial_log_success
toolkit/mozapps/update/test/unit/data/partial_log_switch_success
toolkit/mozapps/update/test/unit/data/partial_precomplete
toolkit/mozapps/update/test/unit/data/partial_removed-files
toolkit/mozapps/update/test/unit/data/partial_update_manifest
toolkit/mozapps/update/test/unit/data/partial_win.mar
toolkit/mozapps/update/test/unit/data/simple.mar
toolkit/mozapps/update/test/unit/data/simple_no_pib.mar
toolkit/mozapps/update/test/unit/data/wrong_product_channel_mar.mar
toolkit/mozapps/update/test/unit/head_update.js.in
toolkit/mozapps/update/test/unit/test_0010_general.js
toolkit/mozapps/update/test/unit/test_0020_general.js
toolkit/mozapps/update/test/unit/test_0030_general.js
toolkit/mozapps/update/test/unit/test_0040_general.js
toolkit/mozapps/update/test/unit/test_0050_general.js
toolkit/mozapps/update/test/unit/test_0060_manager.js
toolkit/mozapps/update/test/unit/test_0061_manager.js
toolkit/mozapps/update/test/unit/test_0062_manager.js
toolkit/mozapps/update/test/unit/test_0063_manager.js
toolkit/mozapps/update/test/unit/test_0064_manager.js
toolkit/mozapps/update/test/unit/test_0070_update_dir_cleanup.js
toolkit/mozapps/update/test/unit/test_0071_update_dir_cleanup.js
toolkit/mozapps/update/test/unit/test_0072_update_dir_cleanup.js
toolkit/mozapps/update/test/unit/test_0073_update_dir_cleanup.js
toolkit/mozapps/update/test/unit/test_0080_prompt_silent.js
toolkit/mozapps/update/test/unit/test_0081_prompt_uiAlreadyOpen.js
toolkit/mozapps/update/test/unit/test_0082_prompt_unsupportAlreadyNotified.js
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_0113_general.js
toolkit/mozapps/update/test/unit/test_0113_versionDowngradeCheck.js
toolkit/mozapps/update/test/unit/test_0114_general.js
toolkit/mozapps/update/test/unit/test_0114_productChannelCheck.js
toolkit/mozapps/update/test/unit/test_0115_general.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_0152_appBinReplaced_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0153_appBinPatched_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js
toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_unix_complete.js
toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0162_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_0172_fileLocked_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0173_fileLocked_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0174_fileLocked_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0175_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_0184_fileInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0185_fileInUse_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0186_rmrfdirFileInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0187_rmrfdirFileInUse_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0188_fileInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0189_fileInUse_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0190_rmrfdirFileInUse_xp_win_complete.js
toolkit/mozapps/update/test/unit/test_0191_rmrfdirFileInUse_xp_win_partial.js
toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js
toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js
toolkit/mozapps/update/test/unit/test_0202_app_launch_apply_update_dirlocked.js
toolkit/mozapps/update/test/unit/test_0203_app_launch_apply_update.js
toolkit/mozapps/update/test/unit/test_0300_update_root_dir_migration.js
toolkit/mozapps/update/test/unit/test_bug595059.js
toolkit/mozapps/update/test/unit/test_bug794211.js
toolkit/mozapps/update/test/unit/test_bug833708.js
toolkit/mozapps/update/test/unit/xpcshell.ini
toolkit/mozapps/update/test/unit/xpcshell_updater.ini
toolkit/mozapps/update/test_svc/Makefile.in
toolkit/mozapps/update/test_svc/moz.build
toolkit/mozapps/update/test_svc/unit/test_0000_bootstrap_svc.js
toolkit/mozapps/update/test_svc/unit/test_0110_general_svc.js
toolkit/mozapps/update/test_svc/unit/test_0111_general_svc.js
toolkit/mozapps/update/test_svc/unit/test_0112_general_svc.js
toolkit/mozapps/update/test_svc/unit/test_0113_general_svc.js
toolkit/mozapps/update/test_svc/unit/test_0114_general_svc.js
toolkit/mozapps/update/test_svc/unit/test_0115_general_svc.js
toolkit/mozapps/update/test_svc/unit/test_0150_appBinReplaced_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0151_appBinPatched_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0152_appBinReplaced_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0153_appBinPatched_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0161_appInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0162_appInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0170_fileLocked_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0171_fileLocked_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0172_fileLocked_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0173_fileLocked_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0174_fileLocked_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0175_fileLocked_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0180_fileInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0181_fileInUse_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0182_rmrfdirFileInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0183_rmrfdirFileInUse_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0184_fileInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0185_fileInUse_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0186_rmrfdirFileInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0187_rmrfdirFileInUse_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0188_fileInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0189_fileInUse_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0190_rmrfdirFileInUse_xp_win_complete_svc.js
toolkit/mozapps/update/test_svc/unit/test_0191_rmrfdirFileInUse_xp_win_partial_svc.js
toolkit/mozapps/update/test_svc/unit/test_0200_app_launch_apply_update_svc.js
toolkit/mozapps/update/test_svc/unit/test_0201_app_launch_apply_update_svc.js
toolkit/mozapps/update/test_svc/unit/test_0202_app_launch_apply_update_dirlocked_svc.js
toolkit/mozapps/update/test_svc/unit/test_0203_app_launch_apply_update_svc.js
toolkit/mozapps/update/test_svc/unit/xpcshell.ini
toolkit/mozapps/update/test_timermanager/moz.build
toolkit/mozapps/update/test_timermanager/unit/test_0010_timermanager.js
toolkit/mozapps/update/test_timermanager/unit/xpcshell.ini
--- a/browser/devtools/profiler/cleopatra/js/ui.js
+++ b/browser/devtools/profiler/cleopatra/js/ui.js
@@ -535,26 +535,16 @@ HistogramView.prototype = {
         ctx.fillStyle = "green";
       } else if (isInRangeSelector) {
         ctx.fillStyle = "blue";
       } else {
         ctx.fillStyle = step.color;
       }
       var roundedHeight = Math.round(step.value * height);
       ctx.fillRect(step.x, height - roundedHeight, step.width, roundedHeight);
-      if (step.marker) {
-        var x = step.x + step.width + 2;
-        var endPoint = x + ctx.measureText(step.marker).width;
-        var lastDataPoint = this._histogramData[this._histogramData.length-1];
-        if (endPoint >= lastDataPoint.x + lastDataPoint.width) {
-          x -= endPoint - (lastDataPoint.x + lastDataPoint.width) - 1;
-        }
-        ctx.fillText(step.marker, x, 15 + ((markerCount % 2) == 0 ? 0 : 20));
-        markerCount++;
-      }
     }
 
     this._finishedRendering = true;
   },
   highlightedCallstackChanged: function HistogramView_highlightedCallstackChanged(highlightedCallstack) {
     this._scheduleRender(highlightedCallstack);
   },
   _isInRangeSelector: function HistogramView_isInRangeSelector(index) {
--- a/browser/metro/theme/platform.css
+++ b/browser/metro/theme/platform.css
@@ -682,17 +682,17 @@ arrowbox {
 .meta-section-container[viewstate="snapped"] .meta-section-title,
 .meta-section-container[viewstate="snapped"] richgrid {
   margin-top: @metro_spacing_xnormal@;
   padding: 0;
 }
 
 .meta-section > richgrid {
   opacity: 1;
-  transform: translateX(0) scale(1);
+  transform: translateX(0) translateY(0);
   transition-duration: 367ms;
   transition-delay: 500ms;
   transition-timing-function: @metro_animation_easing@;
 }
 
 .meta-section:nth-child(2) > richgrid {
   transition-delay: 600ms;
 }
@@ -700,17 +700,17 @@ arrowbox {
   transition-delay: 700ms;
 }
 .meta-section:nth-child(4) > richgrid {
   transition-delay: 800ms;
 }
 
 .meta-section > richgrid[fade] {
   opacity: 0;
-  transform: translateX(150px) scale(.9);
+  transform: translateX(150px) translateY(25px);
 }
 
 #start-container[viewstate="snapped"] .meta-section > richgrid {
   transition-property: none;
 }
 
 
 /* App bars ----------------------------------------------------------------- */
--- a/testing/marionette/client/marionette/tests/update-tests.ini
+++ b/testing/marionette/client/marionette/tests/update-tests.ini
@@ -10,9 +10,9 @@ b2g = true
 
 ; true if the test should be skipped
 skip = false
 
 ; this is currently only set by high level update smoketests
 smoketest = false
 
 ; AUS tests
-[include:../../../../../toolkit/mozapps/update/test/marionette/update-tests.ini]
+[include:../../../../../toolkit/mozapps/update/tests/marionette/update-tests.ini]
--- a/testing/xpcshell/xpcshell_b2g.ini
+++ b/testing/xpcshell/xpcshell_b2g.ini
@@ -4,14 +4,13 @@
 
 [include:dom/apps/tests/unit/xpcshell.ini]
 [include:dom/mobilemessage/tests/xpcshell.ini]
 [include:dom/system/gonk/tests/xpcshell.ini]
 [include:toolkit/devtools/apps/tests/unit/xpcshell.ini]
 [include:toolkit/devtools/debugger/tests/unit/xpcshell.ini]
 [include:toolkit/devtools/sourcemap/tests/unit/xpcshell.ini]
 [include:toolkit/mozapps/downloads/tests/unit/xpcshell.ini]
-[include:toolkit/mozapps/update/test_timermanager/unit/xpcshell.ini]
-[include:toolkit/mozapps/update/test_svc/unit/xpcshell.ini]
-[include:toolkit/mozapps/update/test/unit/xpcshell.ini]
-[include:toolkit/mozapps/shared/test/unit/xpcshell.ini]
+[include:toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini]
+[include:toolkit/mozapps/update/test/unit_base_updater/xpcshell.ini]
+[include:toolkit/mozapps/update/tests/unit_timermanager/xpcshell.ini]
 [include:ipc/testshell/tests/xpcshell.ini]
 [include:b2g/components/test/unit/xpcshell.ini]
--- a/toolkit/mozapps/update/moz.build
+++ b/toolkit/mozapps/update/moz.build
@@ -9,42 +9,36 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'andr
         DIRS += ['common', 'updater']
     elif CONFIG['MOZ_MAINTENANCE_SERVICE']:
         # If only the maintenance service is installed and not
         # the updater, then the maintenance service may still be
         # used for other things.  We need to build update/common
         # which the maintenance service uses.
         DIRS += ['common']
 
-TEST_DIRS += ['test_timermanager']
+MODULE = 'update'
+
+XPCSHELL_TESTS_MANIFESTS += ['tests/unit_timermanager/xpcshell.ini']
 
 XPIDL_SOURCES += [
     'nsIUpdateTimerManager.idl',
 ]
 
-# Update tests require the updater binary
-if CONFIG['MOZ_UPDATER']:
-    TEST_DIRS += ['test']
-
-    if CONFIG['MOZ_MAINTENANCE_SERVICE']:
-        TEST_DIRS += ['test_svc']
-
-    XPIDL_SOURCES += [
-        'nsIUpdateService.idl',
-    ]
-
-MODULE = 'update'
-
 EXTRA_COMPONENTS += [
     'nsUpdateTimerManager.js',
     'nsUpdateTimerManager.manifest',
 ]
 
 if CONFIG['MOZ_UPDATER']:
+    TEST_DIRS += ['tests']
+
+    XPIDL_SOURCES += [
+        'nsIUpdateService.idl',
+    ]
+
     EXTRA_COMPONENTS += [
         'nsUpdateService.manifest',
     ]
 
-if CONFIG['MOZ_UPDATER']:
     EXTRA_PP_COMPONENTS += [
         'nsUpdateService.js',
         'nsUpdateServiceStub.js',
     ]
deleted file mode 100644
--- a/toolkit/mozapps/update/test/chrome/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-MOCHITEST_CHROME_FILES := \
-  ../unit/data/simple.mar \
-  ../unit/data/simple_no_pib.mar \
-  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-libs:: 
-	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(srcdir)/utils.js > \
-    $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/utils.js
-	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(srcdir)/update.sjs > \
-    $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/update.sjs
deleted file mode 100644
--- a/toolkit/mozapps/update/test/chrome/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-MOCHITEST_CHROME_MANIFESTS += ['chrome.ini']
-
deleted file mode 100644
--- a/toolkit/mozapps/update/test_svc/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-TESTROOT = $(abspath $(DEPTH))/_tests/xpcshell/$(relativesrcdir)
-
-DEFINES += \
-  -DAB_CD=$(AB_CD) \
-  -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-  -DMOZ_APP_DISPLAYNAME="$(MOZ_APP_DISPLAYNAME)" \
-  -DBIN_SUFFIX=$(BIN_SUFFIX) \
-  -DNS_NO_XPCOM \
-  -DMOZ_DEBUG=$(MOZ_DEBUG) \
-  $(NULL)
-
-# For debugging purposes only
-#DEFINES += -DDISABLE_UPDATER_AUTHENTICODE_CHECK
-
-include $(topsrcdir)/config/rules.mk
-
-libs:: ../test/unit/head_update.js.in
-	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $^ > $(TESTROOT)/unit/head_update.js
-
-ifneq ($(OS_TARGET),Android)
-ifndef MOZ_PROFILE_GENERATE
-libs::
-	$(INSTALL) ../test/TestAUSHelper$(BIN_SUFFIX) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
-	$(INSTALL) -D $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/data
-	$(INSTALL) $(topsrcdir)/$(relativesrcdir)/../test/unit/data/* $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/data
-endif
-endif # Not Android
deleted file mode 100644
--- a/toolkit/mozapps/update/test_svc/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
deleted file mode 100644
--- a/toolkit/mozapps/update/test_timermanager/moz.build
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-MODULE = 'test_timermanager'
-
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
rename from toolkit/mozapps/update/test/Makefile.in
rename to toolkit/mozapps/update/tests/Makefile.in
--- a/toolkit/mozapps/update/test/Makefile.in
+++ b/toolkit/mozapps/update/tests/Makefile.in
@@ -1,28 +1,77 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-TESTROOT = $(abspath $(DEPTH))/_tests/xpcshell/$(relativesrcdir)
+XPCSHELLTESTROOT = $(abspath $(DEPTH))/_tests/xpcshell/$(relativesrcdir)
+CHROMETESTROOT = $(abspath $(DEPTH))/_tests/testing/mochitest/chrome/$(relativesrcdir)
 
 DEFINES += \
   -DAB_CD=$(AB_CD) \
   -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
   -DMOZ_APP_DISPLAYNAME="$(MOZ_APP_DISPLAYNAME)" \
   -DBIN_SUFFIX=$(BIN_SUFFIX) \
   -DNS_NO_XPCOM \
   -DMOZ_DEBUG=$(MOZ_DEBUG) \
   $(NULL)
 
 ifdef MOZ_MAINTENANCE_SERVICE
 DEFINES += -DMOZ_MAINTENANCE_SERVICE=$(MOZ_MAINTENANCE_SERVICE)
 endif
 
+# For debugging purposes only
+#DEFINES += -DDISABLE_UPDATER_AUTHENTICODE_CHECK
+
+PP_TARGETS            += aus-update-head
+aus-update-head_FLAGS := -Fsubstitution $(DEFINES) $(ACDEFINES)
+aus-update-head       := $(srcdir)/unit_aus_update/head_update.js
+aus-update-head_PATH  := $(XPCSHELLTESTROOT)/unit_aus_update
+
+INSTALL_TARGETS       += xpcshell-data
+xpcshell-data_TARGET  := libs
+xpcshell-data_DEST    := $(XPCSHELLTESTROOT)/data
+xpcshell-data_FILES   := $(wildcard $(srcdir)/data/*)
+
+# Android doesn't use the Mozilla updater or the toolkit update UI
 ifneq (android,$(MOZ_WIDGET_TOOLKIT))
+INSTALL_TARGETS           += base-updater-head
+base-updater-head_TARGET  := libs
+base-updater-head_DEST    := $(XPCSHELLTESTROOT)/unit_base_updater
+base-updater-head_FILES   := $(XPCSHELLTESTROOT)/unit_aus_update/head_update.js
+
+INSTALL_TARGETS              += service-updater-head
+service-updater-head_TARGET  := libs
+service-updater-head_DEST    := $(XPCSHELLTESTROOT)/unit_service_updater
+service-updater-head_FILES   := $(XPCSHELLTESTROOT)/unit_aus_update/head_update.js
+
+ifndef MOZ_PROFILE_GENERATE
+INSTALL_TARGETS              += xpcshell-test-helper
+xpcshell-test-helper_TARGET  := libs
+xpcshell-test-helper_DEST    := $(XPCSHELLTESTROOT)/data
+xpcshell-test-helper_FILES   := $(DIST)/bin/TestAUSHelper$(BIN_SUFFIX)
+endif # Not MOZ_PROFILE_GENERATE
+
+_CHROME_SHARED := \
+  update.sjs \
+  utils.js \
+  $(NULL)
+PP_TARGETS         += chrome-shared
+chrome-shared      := $(addprefix $(srcdir)/chrome/,$(_CHROME_SHARED))
+chrome-shared_PATH := $(CHROMETESTROOT)/chrome
+
+_CHROME_DATA := \
+  simple.mar \
+  simple_no_pib.mar \
+  $(NULL)
+INSTALL_TARGETS     += chrome-data
+chrome-data_TARGET  := libs
+chrome-data_DEST    := $(CHROMETESTROOT)/data
+chrome-data_FILES   := $(addprefix $(srcdir)/data/,$(_CHROME_DATA))
+
 INI_TEST_FILES = \
   TestAUSReadStrings1.ini \
   TestAUSReadStrings2.ini \
   TestAUSReadStrings3.ini \
   $(NULL)
 
 LOCAL_INCLUDES += \
   -I$(srcdir) \
@@ -34,17 +83,17 @@ MOZ_WINCONSOLE = 1
 
 LIBS += \
   ../common/$(LIB_PREFIX)updatecommon.$(LIB_SUFFIX) \
   $(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 USE_STATIC_LIBS = 1
 DEFINES += -DUNICODE -D_UNICODE
-endif
+endif # WINNT
 endif # Not Android
 
 include $(topsrcdir)/config/rules.mk
 
 ifneq (android,$(MOZ_WIDGET_TOOLKIT))
 # TestAUSReadStrings runs during check in the following directory with a Unicode
 # char in order to test bug 473417 on Windows.
 ifeq ($(OS_ARCH),WINNT)
@@ -56,18 +105,8 @@ endif
 check::
 	$(RM) -rf $(DEPTH)/_tests/updater/ && $(NSINSTALL) -D $(DEPTH)/_tests/updater/$(bug473417dir)/
 	for i in $(INI_TEST_FILES); do \
 	  $(INSTALL) $(srcdir)/$$i $(DEPTH)/_tests/updater/$(bug473417dir)/; \
 	done
 	$(INSTALL) $(FINAL_TARGET)/TestAUSReadStrings$(BIN_SUFFIX) $(DEPTH)/_tests/updater/$(bug473417dir)/
 	@$(RUN_TEST_PROGRAM) $(DEPTH)/_tests/updater/$(bug473417dir)/TestAUSReadStrings$(BIN_SUFFIX)
 endif # Not Android
-
-libs:: unit/head_update.js.in
-	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $^ > $(TESTROOT)/unit/head_update.js
-
-ifneq (android,$(MOZ_WIDGET_TOOLKIT))
-ifndef MOZ_PROFILE_GENERATE
-libs::
-	$(INSTALL) TestAUSHelper$(BIN_SUFFIX) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
-endif
-endif
rename from toolkit/mozapps/update/test/TestAUSHelper.cpp
rename to toolkit/mozapps/update/tests/TestAUSHelper.cpp
rename from toolkit/mozapps/update/test/TestAUSReadStrings.cpp
rename to toolkit/mozapps/update/tests/TestAUSReadStrings.cpp
rename from toolkit/mozapps/update/test/TestAUSReadStrings1.ini
rename to toolkit/mozapps/update/tests/TestAUSReadStrings1.ini
rename from toolkit/mozapps/update/test/TestAUSReadStrings2.ini
rename to toolkit/mozapps/update/tests/TestAUSReadStrings2.ini
rename from toolkit/mozapps/update/test/TestAUSReadStrings3.ini
rename to toolkit/mozapps/update/tests/TestAUSReadStrings3.ini
rename from toolkit/mozapps/update/test/chrome/chrome.ini
rename to toolkit/mozapps/update/tests/chrome/chrome.ini
--- a/toolkit/mozapps/update/test/chrome/chrome.ini
+++ b/toolkit/mozapps/update/tests/chrome/chrome.ini
@@ -1,13 +1,22 @@
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
 [DEFAULT]
 support-files =
-  ../unit/data/simple.mar
-  ../unit/data/simple_no_pib.mar
+  utils.js
+  update.sjs
+generated-files =
+  utils.js
+  update.sjs
 
+; mochitest-chrome tests must start with "test_" and are executed in sorted
+; order and not in the order specified in the manifest.
 [test_0011_check_basic.xul]
 [test_0012_check_basic_license.xul]
 [test_0013_check_incompat_basic.xul]
 [test_0014_check_incompat_basic_license.xul]
 [test_0015_check_incompat_basic_addons.xul]
 [test_0016_check_incompat_basic_license_addons.xul]
 [test_0017_check_staging_basic.xul]
 skip-if = os == 'linux'
rename from toolkit/mozapps/update/test/chrome/test_0011_check_basic.xul
rename to toolkit/mozapps/update/tests/chrome/test_0011_check_basic.xul
--- a/toolkit/mozapps/update/test/chrome/test_0011_check_basic.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0011_check_basic.xul
@@ -29,17 +29,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0012_check_basic_license.xul
rename to toolkit/mozapps/update/tests/chrome/test_0012_check_basic_license.xul
--- a/toolkit/mozapps/update/test/chrome/test_0012_check_basic_license.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0012_check_basic_license.xul
@@ -69,17 +69,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showLicense=1&showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showLicense=1&showDetails=1" +
+            getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0013_check_incompat_basic.xul
rename to toolkit/mozapps/update/tests/chrome/test_0013_check_incompat_basic.xul
--- a/toolkit/mozapps/update/test/chrome/test_0013_check_incompat_basic.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0013_check_incompat_basic.xul
@@ -33,17 +33,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 gDisableNoUpdateAddon = true;
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0014_check_incompat_basic_license.xul
rename to toolkit/mozapps/update/tests/chrome/test_0014_check_incompat_basic_license.xul
--- a/toolkit/mozapps/update/test/chrome/test_0014_check_incompat_basic_license.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0014_check_incompat_basic_license.xul
@@ -73,17 +73,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 gDisableNoUpdateAddon = true;
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showLicense=1&showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showLicense=1&showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0015_check_incompat_basic_addons.xul
rename to toolkit/mozapps/update/tests/chrome/test_0015_check_incompat_basic_addons.xul
--- a/toolkit/mozapps/update/test/chrome/test_0015_check_incompat_basic_addons.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0015_check_incompat_basic_addons.xul
@@ -42,17 +42,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0016_check_incompat_basic_license_addons.xul
rename to toolkit/mozapps/update/tests/chrome/test_0016_check_incompat_basic_license_addons.xul
--- a/toolkit/mozapps/update/test/chrome/test_0016_check_incompat_basic_license_addons.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0016_check_incompat_basic_license_addons.xul
@@ -82,17 +82,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showLicense=1&showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showLicense=1&showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0017_check_staging_basic.xul
rename to toolkit/mozapps/update/tests/chrome/test_0017_check_staging_basic.xul
--- a/toolkit/mozapps/update/test/chrome/test_0017_check_staging_basic.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0017_check_staging_basic.xul
@@ -31,17 +31,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
   Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
 
-  let url = URL_UPDATE + "?showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   setupTimer(180000); // 180 seconds
 
   gUP.checkForUpdates();
 }
 
 ]]>
rename from toolkit/mozapps/update/test/chrome/test_0021_check_billboard.xul
rename to toolkit/mozapps/update/tests/chrome/test_0021_check_billboard.xul
--- a/toolkit/mozapps/update/test/chrome/test_0021_check_billboard.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0021_check_billboard.xul
@@ -36,17 +36,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showDetails=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0022_check_billboard_license.xul
rename to toolkit/mozapps/update/tests/chrome/test_0022_check_billboard_license.xul
--- a/toolkit/mozapps/update/test/chrome/test_0022_check_billboard_license.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0022_check_billboard_license.xul
@@ -78,18 +78,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showLicense=1&showDetails=1" +
-            getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showLicense=1" +
+            "&showDetails=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0023_check_incompat_billboard.xul
rename to toolkit/mozapps/update/tests/chrome/test_0023_check_incompat_billboard.xul
--- a/toolkit/mozapps/update/test/chrome/test_0023_check_incompat_billboard.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0023_check_incompat_billboard.xul
@@ -40,17 +40,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 gDisableNoUpdateAddon = true;
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0024_check_incompat_billboard_license.xul
rename to toolkit/mozapps/update/tests/chrome/test_0024_check_incompat_billboard_license.xul
--- a/toolkit/mozapps/update/test/chrome/test_0024_check_incompat_billboard_license.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0024_check_incompat_billboard_license.xul
@@ -82,17 +82,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 gDisableNoUpdateAddon = true;
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showLicense=1&showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showLicense=1&showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0025_check_incompat_billboard_addons.xul
rename to toolkit/mozapps/update/tests/chrome/test_0025_check_incompat_billboard_addons.xul
--- a/toolkit/mozapps/update/test/chrome/test_0025_check_incompat_billboard_addons.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0025_check_incompat_billboard_addons.xul
@@ -51,17 +51,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0026_check_incompat_billboard_license_addons.xul
rename to toolkit/mozapps/update/tests/chrome/test_0026_check_incompat_billboard_license_addons.xul
--- a/toolkit/mozapps/update/test/chrome/test_0026_check_incompat_billboard_license_addons.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0026_check_incompat_billboard_license_addons.xul
@@ -91,17 +91,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showLicense=1&showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showLicense=1&showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0031_available_basic.xul
rename to toolkit/mozapps/update/tests/chrome/test_0031_available_basic.xul
--- a/toolkit/mozapps/update/test/chrome/test_0031_available_basic.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0031_available_basic.xul
@@ -27,17 +27,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1&showPrompt=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&showPrompt=1" +
+            getVersionParams();
   setUpdateURLOverride(url);
 
   gAUS.checkForBackgroundUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0032_available_basic_license.xul
rename to toolkit/mozapps/update/tests/chrome/test_0032_available_basic_license.xul
--- a/toolkit/mozapps/update/test/chrome/test_0032_available_basic_license.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0032_available_basic_license.xul
@@ -67,17 +67,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showLicense=1&showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showLicense=1&showDetails=1&showPrompt=1" +
             getVersionParams();
   setUpdateURLOverride(url);
 
   gAUS.checkForBackgroundUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0033_available_incompat_basic.xul
rename to toolkit/mozapps/update/tests/chrome/test_0033_available_incompat_basic.xul
--- a/toolkit/mozapps/update/test/chrome/test_0033_available_incompat_basic.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0033_available_incompat_basic.xul
@@ -31,17 +31,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 gDisableNoUpdateAddon = true;
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&showPrompt=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gAUS.checkForBackgroundUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0034_available_incompat_basic_license.xul
rename to toolkit/mozapps/update/tests/chrome/test_0034_available_incompat_basic_license.xul
--- a/toolkit/mozapps/update/test/chrome/test_0034_available_incompat_basic_license.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0034_available_incompat_basic_license.xul
@@ -71,17 +71,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 gDisableNoUpdateAddon = true;
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showLicense=1&showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showLicense=1&showDetails=1&showPrompt=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gAUS.checkForBackgroundUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0035_available_incompat_basic_addons.xul
rename to toolkit/mozapps/update/tests/chrome/test_0035_available_incompat_basic_addons.xul
--- a/toolkit/mozapps/update/test/chrome/test_0035_available_incompat_basic_addons.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0035_available_incompat_basic_addons.xul
@@ -40,17 +40,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&showPrompt=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gAUS.checkForBackgroundUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0036_available_incompat_basic_license_addons.xul
rename to toolkit/mozapps/update/tests/chrome/test_0036_available_incompat_basic_license_addons.xul
--- a/toolkit/mozapps/update/test/chrome/test_0036_available_incompat_basic_license_addons.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0036_available_incompat_basic_license_addons.xul
@@ -80,17 +80,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showLicense=1&showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showLicense=1&showDetails=1&showPrompt=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gAUS.checkForBackgroundUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0041_available_billboard.xul
rename to toolkit/mozapps/update/tests/chrome/test_0041_available_billboard.xul
--- a/toolkit/mozapps/update/test/chrome/test_0041_available_billboard.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0041_available_billboard.xul
@@ -34,17 +34,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showDetails=1&showPrompt=1" +
             getVersionParams();
   setUpdateURLOverride(url);
 
   gAUS.notify(null);
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0042_available_billboard_license.xul
rename to toolkit/mozapps/update/tests/chrome/test_0042_available_billboard_license.xul
--- a/toolkit/mozapps/update/test/chrome/test_0042_available_billboard_license.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0042_available_billboard_license.xul
@@ -76,18 +76,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showLicense=1&showDetails=1" +
-            "&showPrompt=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showLicense=1" +
+            "&showDetails=1&showPrompt=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gAUS.notify(null);
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0043_available_incompat_billboard.xul
rename to toolkit/mozapps/update/tests/chrome/test_0043_available_incompat_billboard.xul
--- a/toolkit/mozapps/update/test/chrome/test_0043_available_incompat_billboard.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0043_available_incompat_billboard.xul
@@ -38,17 +38,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 gDisableNoUpdateAddon = true;
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showPrompt=1&showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showPrompt=1&showDetails=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gAUS.notify(null);
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0044_available_incompat_billboard_license.xul
rename to toolkit/mozapps/update/tests/chrome/test_0044_available_incompat_billboard_license.xul
--- a/toolkit/mozapps/update/test/chrome/test_0044_available_incompat_billboard_license.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0044_available_incompat_billboard_license.xul
@@ -80,17 +80,18 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 gDisableNoUpdateAddon = true;
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showLicense=1&showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showLicense=1" +
+            "&showDetails=1&showPrompt=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gAUS.notify(null);
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0045_available_incompat_billboard_addons.xul
rename to toolkit/mozapps/update/tests/chrome/test_0045_available_incompat_billboard_addons.xul
--- a/toolkit/mozapps/update/test/chrome/test_0045_available_incompat_billboard_addons.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0045_available_incompat_billboard_addons.xul
@@ -49,17 +49,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showDetails=1&showPrompt=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gAUS.notify(null);
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0046_available_incompat_billboard_license_addons.xul
rename to toolkit/mozapps/update/tests/chrome/test_0046_available_incompat_billboard_license_addons.xul
--- a/toolkit/mozapps/update/test/chrome/test_0046_available_incompat_billboard_license_addons.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0046_available_incompat_billboard_license_addons.xul
@@ -89,17 +89,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showLicense=1&showDetails=1&showPrompt=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showLicense=1" +
+            "&showDetails=1&showPrompt=1" +
             getVersionParams(getNewerAppVersion(), getNewerPlatformVersion());
   setUpdateURLOverride(url);
 
   gAUS.notify(null);
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0051_check_error_xml_malformed.xul
rename to toolkit/mozapps/update/tests/chrome/test_0051_check_error_xml_malformed.xul
--- a/toolkit/mozapps/update/test/chrome/test_0051_check_error_xml_malformed.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0051_check_error_xml_malformed.xul
@@ -24,17 +24,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_ERRORS,
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?xmlMalformed=1";
+  let url = URL_HTTP_UPDATE_XML + "?xmlMalformed=1";
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0052_check_no_updates.xul
rename to toolkit/mozapps/update/tests/chrome/test_0052_check_no_updates.xul
--- a/toolkit/mozapps/update/test/chrome/test_0052_check_no_updates.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0052_check_no_updates.xul
@@ -24,17 +24,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_NO_UPDATES_FOUND,
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?noUpdates=1";
+  let url = URL_HTTP_UPDATE_XML + "?noUpdates=1";
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0053_check_billboard_license_noAttr.xul
rename to toolkit/mozapps/update/tests/chrome/test_0053_check_billboard_license_noAttr.xul
--- a/toolkit/mozapps/update/test/chrome/test_0053_check_billboard_license_noAttr.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0053_check_billboard_license_noAttr.xul
@@ -35,18 +35,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_MANUAL_UPDATE,
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showLicense=1&remoteNoTypeAttr=1" +
-            "&showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showLicense=1" +
+            "&remoteNoTypeAttr=1&showDetails=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0054_check_billboard_license_404.xul
rename to toolkit/mozapps/update/tests/chrome/test_0054_check_billboard_license_404.xul
--- a/toolkit/mozapps/update/test/chrome/test_0054_check_billboard_license_404.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0054_check_billboard_license_404.xul
@@ -35,17 +35,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_MANUAL_UPDATE,
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?billboard404=1&license404=1&showDetails=1" +
+  let url = URL_HTTP_UPDATE_XML + "?billboard404=1&license404=1&showDetails=1" +
             getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0061_check_verifyFailPartial_noComplete.xul
rename to toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul
--- a/toolkit/mozapps/update/test/chrome/test_0061_check_verifyFailPartial_noComplete.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul
@@ -29,18 +29,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_ERRORS,
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1&partialPatchOnly=1&invalidPartialHash=1" +
-            getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&partialPatchOnly=1" +
+            "&invalidPartialHash=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0062_check_verifyFailComplete_noPartial.xul
rename to toolkit/mozapps/update/tests/chrome/test_0062_check_verifyFailComplete_noPartial.xul
--- a/toolkit/mozapps/update/test/chrome/test_0062_check_verifyFailComplete_noPartial.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0062_check_verifyFailComplete_noPartial.xul
@@ -29,18 +29,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_ERRORS,
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1&completePatchOnly=1&invalidCompleteHash=1" +
-            getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&completePatchOnly=1" +
+            "&invalidCompleteHash=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0063_check_verifyFailPartialComplete.xul
rename to toolkit/mozapps/update/tests/chrome/test_0063_check_verifyFailPartialComplete.xul
--- a/toolkit/mozapps/update/test/chrome/test_0063_check_verifyFailPartialComplete.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0063_check_verifyFailPartialComplete.xul
@@ -29,18 +29,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_ERRORS,
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1&invalidPartialHash=1&invalidCompleteHash=1" +
-            getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&invalidPartialHash=1" +
+            "&invalidCompleteHash=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0064_check_verifyFailPartial_successComplete.xul
rename to toolkit/mozapps/update/tests/chrome/test_0064_check_verifyFailPartial_successComplete.xul
--- a/toolkit/mozapps/update/test/chrome/test_0064_check_verifyFailPartial_successComplete.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0064_check_verifyFailPartial_successComplete.xul
@@ -29,17 +29,17 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FINISHED,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1&invalidPartialHash=1" +
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&invalidPartialHash=1" +
             getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
rename from toolkit/mozapps/update/test/chrome/test_0071_notify_verifyFailPartial_noComplete.xul
rename to toolkit/mozapps/update/tests/chrome/test_0071_notify_verifyFailPartial_noComplete.xul
rename from toolkit/mozapps/update/test/chrome/test_0072_notify_verifyFailComplete_noPartial.xul
rename to toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul
rename from toolkit/mozapps/update/test/chrome/test_0073_notify_verifyFailPartialComplete.xul
rename to toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul
rename from toolkit/mozapps/update/test/chrome/test_0074_notify_verifyFailPartial_successComplete.xul
rename to toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul
rename from toolkit/mozapps/update/test/chrome/test_0081_error_patchApplyFailure_partial_only.xul
rename to toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul
rename from toolkit/mozapps/update/test/chrome/test_0082_error_patchApplyFailure_complete_only.xul
rename to toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul
rename from toolkit/mozapps/update/test/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
rename to toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
--- a/toolkit/mozapps/update/test/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
@@ -29,17 +29,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
   // Specify the url to update.sjs with a slowDownloadMar param so the ui can
   // load before the download completes.
-  let slowDownloadURL = URL_UPDATE + "?slowDownloadMar=1";
+  let slowDownloadURL = URL_HTTP_UPDATE_XML + "?slowDownloadMar=1";
   let patches = getLocalPatchString("partial", null, null, null, null, null,
                                     STATE_PENDING) +
                 getLocalPatchString("complete", slowDownloadURL, null, null,
                                     null, "false");
   let updates = getLocalUpdateString(patches, null, null, null,
                                      Services.appinfo.version,
                                      Services.appinfo.platformVersion, null,
                                      null, null, null, null, null, null,
rename from toolkit/mozapps/update/test/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
rename to toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
--- a/toolkit/mozapps/update/test/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
@@ -29,17 +29,17 @@ const TESTS = [ {
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
   // Specify the url to update.sjs with a slowDownloadMar param so the ui can
   // load before the download completes.
-  let slowDownloadURL = URL_UPDATE + "?slowDownloadMar=1";
+  let slowDownloadURL = URL_HTTP_UPDATE_XML + "?slowDownloadMar=1";
   let patches = getLocalPatchString("partial", null, null, null, null, null,
                                     STATE_PENDING) +
                 getLocalPatchString("complete", slowDownloadURL, "MD5",
                                     "1234cd43a1c77e30191c53a329a3f99d", null,
                                     "false");
   let updates = getLocalUpdateString(patches, null, null, null,
                                      Services.appinfo.version,
                                      Services.appinfo.platformVersion, null,
rename from toolkit/mozapps/update/test/chrome/test_0091_installed.xul
rename to toolkit/mozapps/update/tests/chrome/test_0091_installed.xul
rename from toolkit/mozapps/update/test/chrome/test_0092_finishedBackground.xul
rename to toolkit/mozapps/update/tests/chrome/test_0092_finishedBackground.xul
rename from toolkit/mozapps/update/test/chrome/test_0093_restartNotification.xul
rename to toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul
rename from toolkit/mozapps/update/test/chrome/test_0094_restartNotification_remote.xul
rename to toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul
rename from toolkit/mozapps/update/test/chrome/test_0095_restartNotification_remoteInvalidNumber.xul
rename to toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul
rename from toolkit/mozapps/update/test/chrome/test_0096_restartNotification_stagedBackground.xul
rename to toolkit/mozapps/update/tests/chrome/test_0096_restartNotification_stagedBackground.xul
rename from toolkit/mozapps/update/test/chrome/test_0097_restartNotification_stagedServiceBackground.xul
rename to toolkit/mozapps/update/tests/chrome/test_0097_restartNotification_stagedServiceBackground.xul
rename from toolkit/mozapps/update/test/chrome/test_0101_background_restartNotification.xul
rename to toolkit/mozapps/update/tests/chrome/test_0101_background_restartNotification.xul
--- a/toolkit/mozapps/update/test/chrome/test_0101_background_restartNotification.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0101_background_restartNotification.xul
@@ -24,17 +24,17 @@ const TESTS = [ {
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
   Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
 
-  let url = URL_UPDATE + "?showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   gAUS.notify(null);
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0102_background_restartNotification_staging.xul
rename to toolkit/mozapps/update/tests/chrome/test_0102_background_restartNotification_staging.xul
--- a/toolkit/mozapps/update/test/chrome/test_0102_background_restartNotification_staging.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0102_background_restartNotification_staging.xul
@@ -25,17 +25,17 @@ const TESTS = [ {
 } ];
 
 function runTest() {
   debugDump("entering");
 
   Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
   Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
 
-  let url = URL_UPDATE + "?showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   setupTimer(180000); // 180 seconds
 
   gAUS.notify(null);
 }
 
 ]]>
rename from toolkit/mozapps/update/test/chrome/test_0103_background_restartNotification_stagingService.xul
rename to toolkit/mozapps/update/tests/chrome/test_0103_background_restartNotification_stagingService.xul
--- a/toolkit/mozapps/update/test/chrome/test_0103_background_restartNotification_stagingService.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0103_background_restartNotification_stagingService.xul
@@ -26,17 +26,17 @@ const TESTS = [ {
 
 function runTest() {
   debugDump("entering");
 
   Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
   Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
 
-  let url = URL_UPDATE + "?showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
   setUpdateURLOverride(url);
 
   setupTimer(180000); // 180 seconds
 
   gAUS.notify(null);
 }
 
 ]]>
rename from toolkit/mozapps/update/test/chrome/test_0111_neverButton_basic.xul
rename to toolkit/mozapps/update/tests/chrome/test_0111_neverButton_basic.xul
--- a/toolkit/mozapps/update/test/chrome/test_0111_neverButton_basic.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0111_neverButton_basic.xul
@@ -29,17 +29,18 @@ const TESTS = [ {
   prefHasUserValue: false,
   neverButton: true,
   buttonClick: "extra2"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showNever=1&showDetails=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showNever=1&showDetails=1" +
+            getVersionParams();
   setUpdateURLOverride(url);
 
   // add the never preference for this version to verify that checking for
   // updates clears the preference.
   Services.prefs.setBoolPref(gPrefToCheck, true)
 
   gUP.checkForUpdates();
 }
rename from toolkit/mozapps/update/test/chrome/test_0112_neverButton_billboard.xul
rename to toolkit/mozapps/update/tests/chrome/test_0112_neverButton_billboard.xul
--- a/toolkit/mozapps/update/test/chrome/test_0112_neverButton_billboard.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0112_neverButton_billboard.xul
@@ -37,17 +37,18 @@ const TESTS = [ {
   prefHasUserValue: false,
   neverButton: true,
   buttonClick: "extra2"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showBillboard=1&showNever=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showBillboard=1&showNever=1" +
+            getVersionParams();
   setUpdateURLOverride(url);
 
   // add the never preference for this version to verify that checking for
   // updates clears the preference.
   Services.prefs.setBoolPref(gPrefToCheck, true)
 
   gUP.checkForUpdates();
 }
rename from toolkit/mozapps/update/test/chrome/test_0113_showNeverForVersionRemovedWithPref.xul
rename to toolkit/mozapps/update/tests/chrome/test_0113_showNeverForVersionRemovedWithPref.xul
--- a/toolkit/mozapps/update/test/chrome/test_0113_showNeverForVersionRemovedWithPref.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0113_showNeverForVersionRemovedWithPref.xul
@@ -26,17 +26,18 @@ const TESTS = [ {
   extraDelayedCheckFunction: checkPrefHasUserValue,
   prefHasUserValue: true,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?showDetails=1&showPrompt=1" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&showPrompt=1" +
+            getVersionParams();
   setUpdateURLOverride(url);
 
   // add the never preference for this version to verify that checking for
   // updates clears the preference.
   Services.prefs.setBoolPref(gPrefToCheck, true)
 
   gAUS.notify(null);
 }
rename from toolkit/mozapps/update/test/chrome/test_0121_check_requireBuiltinCert.xul
rename to toolkit/mozapps/update/tests/chrome/test_0121_check_requireBuiltinCert.xul
--- a/toolkit/mozapps/update/test/chrome/test_0121_check_requireBuiltinCert.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0121_check_requireBuiltinCert.xul
@@ -79,18 +79,17 @@ function testXHRLoad(aEvent) {
   CERT_ATTRS.forEach(function(aCertAttrName) {
     Services.prefs.setCharPref(PREF_APP_UPDATE_CERTS_BRANCH + "1." +
                                aCertAttrName, cert[aCertAttrName]);
   });
 
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, true);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, false);
 
-  let url = "https://example.com/" + URL_PATH + "/update.sjs?showDetails=1" +
-            getVersionParams();
+  let url = URL_HTTPS_UPDATE_XML + "?showDetails=1" + getVersionParams();
   gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
   debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
   gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
 
   gRequest = null;
   gUP.checkForUpdates();
 }
 
rename from toolkit/mozapps/update/test/chrome/test_0122_check_allowNonBuiltinCert_validCertAttrs.xul
rename to toolkit/mozapps/update/tests/chrome/test_0122_check_allowNonBuiltinCert_validCertAttrs.xul
--- a/toolkit/mozapps/update/test/chrome/test_0122_check_allowNonBuiltinCert_validCertAttrs.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0122_check_allowNonBuiltinCert_validCertAttrs.xul
@@ -79,18 +79,17 @@ function testXHRLoad(aEvent) {
   CERT_ATTRS.forEach(function(aCertAttrName) {
     Services.prefs.setCharPref(PREF_APP_UPDATE_CERTS_BRANCH + "1." +
                                aCertAttrName, cert[aCertAttrName]);
   });
 
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, false);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, true);
 
-  let url = "https://example.com/" + URL_PATH + "/update.sjs?showDetails=1" +
-            getVersionParams();
+  let url = URL_HTTPS_UPDATE_XML + "?showDetails=1" + getVersionParams();
   gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
   debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
   gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
 
   gRequest = null;
   gUP.checkForUpdates();
 }
 
rename from toolkit/mozapps/update/test/chrome/test_0123_check_allowNonBuiltinCert_noCertAttrsCheck.xul
rename to toolkit/mozapps/update/tests/chrome/test_0123_check_allowNonBuiltinCert_noCertAttrsCheck.xul
--- a/toolkit/mozapps/update/test/chrome/test_0123_check_allowNonBuiltinCert_noCertAttrsCheck.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0123_check_allowNonBuiltinCert_noCertAttrsCheck.xul
@@ -32,26 +32,24 @@ function runTest() {
   debugDump("entering");
 
   Services.prefs.setCharPref(PREF_APP_UPDATE_CERT_INVALID_ATTR_NAME,
                              "Invalid Attribute Name");
   Services.prefs.setIntPref(PREF_APP_UPDATE_CERT_ERRORS, 1);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, false);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, false);
 
-  let url = "https://example.com/" + URL_PATH + "/update.sjs?showDetails=1" +
-            getVersionParams();
+  let url = URL_HTTPS_UPDATE_XML + "?showDetails=1" + getVersionParams();
   gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
   debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
   gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
 
   gUP.checkForUpdates();
 }
 
-
 ]]>
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml">
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test"></pre>
 </body>
rename from toolkit/mozapps/update/test/chrome/test_0131_check_invalidCertAttrs_noUpdate.xul
rename to toolkit/mozapps/update/tests/chrome/test_0131_check_invalidCertAttrs_noUpdate.xul
--- a/toolkit/mozapps/update/test/chrome/test_0131_check_invalidCertAttrs_noUpdate.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0131_check_invalidCertAttrs_noUpdate.xul
@@ -33,17 +33,17 @@ function runTest() {
   debugDump("entering");
 
   Services.prefs.setCharPref(PREF_APP_UPDATE_CERT_INVALID_ATTR_NAME,
                              "Invalid Attribute Name");
   Services.prefs.setIntPref(PREF_APP_UPDATE_CERT_ERRORS, 1);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, false);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, true);
 
-  let url = "https://example.com/" + URL_PATH + "/update.sjs?noUpdates=1";
+  let url = URL_HTTPS_UPDATE_XML + "?noUpdates=1";
   gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
   debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
   gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
rename from toolkit/mozapps/update/test/chrome/test_0132_check_invalidCertAttrs_hasUpdate.xul
rename to toolkit/mozapps/update/tests/chrome/test_0132_check_invalidCertAttrs_hasUpdate.xul
--- a/toolkit/mozapps/update/test/chrome/test_0132_check_invalidCertAttrs_hasUpdate.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0132_check_invalidCertAttrs_hasUpdate.xul
@@ -33,18 +33,17 @@ function runTest() {
   debugDump("entering");
 
   Services.prefs.setCharPref(PREF_APP_UPDATE_CERT_INVALID_ATTR_NAME,
                              "Invalid Attribute Name");
   Services.prefs.setIntPref(PREF_APP_UPDATE_CERT_ERRORS, 1);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, false);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, true);
 
-  let url = "https://example.com/" + URL_PATH + "/update.sjs?showDetails=1" +
-            getVersionParams();
+  let url = URL_HTTPS_UPDATE_XML + "?showDetails=1" + getVersionParams();
   gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
   debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
   gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
rename from toolkit/mozapps/update/test/chrome/test_0141_notify_invalidCertAttrs_noUpdate.xul
rename to toolkit/mozapps/update/tests/chrome/test_0141_notify_invalidCertAttrs_noUpdate.xul
--- a/toolkit/mozapps/update/test/chrome/test_0141_notify_invalidCertAttrs_noUpdate.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0141_notify_invalidCertAttrs_noUpdate.xul
@@ -30,17 +30,17 @@ const TESTS = [ {
 function runTest() {
   debugDump("entering");
 
   Services.prefs.setCharPref(PREF_APP_UPDATE_CERT_INVALID_ATTR_NAME,
                              "Invalid Attribute Name");
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, false);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, true);
 
-  let url = "https://example.com/" + URL_PATH + "/update.sjs?noUpdates=1";
+  let url = URL_HTTPS_UPDATE_XML + "?noUpdates=1";
   gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
   debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
   gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
 
   errorsPrefObserver.init(PREF_APP_UPDATE_CERT_ERRORS,
                           PREF_APP_UPDATE_CERT_MAXERRORS);
 
   gAUS.notify(null);
rename from toolkit/mozapps/update/test/chrome/test_0142_notify_invalidCertAttrs_hasUpdate.xul
rename to toolkit/mozapps/update/tests/chrome/test_0142_notify_invalidCertAttrs_hasUpdate.xul
--- a/toolkit/mozapps/update/test/chrome/test_0142_notify_invalidCertAttrs_hasUpdate.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0142_notify_invalidCertAttrs_hasUpdate.xul
@@ -30,18 +30,17 @@ const TESTS = [ {
 function runTest() {
   debugDump("entering");
 
   Services.prefs.setCharPref(PREF_APP_UPDATE_CERT_INVALID_ATTR_NAME,
                              "Invalid Attribute Name");
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_REQUIREBUILTIN, false);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_CERT_CHECKATTRS, true);
 
-  let url = "https://example.com/" + URL_PATH + "/update.sjs?showDetails=1" +
-            getVersionParams();
+  let url = URL_HTTPS_UPDATE_XML + "?showDetails=1" + getVersionParams();
   gAppUpdateURLDefault = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_URL);
   debugDump("setting default pref " + PREF_APP_UPDATE_URL + " to " + url);
   gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
 
   errorsPrefObserver.init(PREF_APP_UPDATE_CERT_ERRORS,
                           PREF_APP_UPDATE_CERT_MAXERRORS);
 
   gAUS.notify(null);
rename from toolkit/mozapps/update/test/chrome/test_0151_notify_backgroundCheckError.xul
rename to toolkit/mozapps/update/tests/chrome/test_0151_notify_backgroundCheckError.xul
--- a/toolkit/mozapps/update/test/chrome/test_0151_notify_backgroundCheckError.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0151_notify_backgroundCheckError.xul
@@ -25,17 +25,17 @@ const TESTS = [ {
   shouldBeHidden: false,
   displayedTextElem: "genericBackgroundErrorLabel",
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?xmlMalformed=1";
+  let url = URL_HTTP_UPDATE_XML + "?xmlMalformed=1";
   setUpdateURLOverride(url);
 
   errorsPrefObserver.init(PREF_APP_UPDATE_BACKGROUNDERRORS,
                           PREF_APP_UPDATE_BACKGROUNDMAXERRORS);
 
   gAUS.notify(null);
 }
 
rename from toolkit/mozapps/update/test/chrome/test_0161_check_unsupported.xul
rename to toolkit/mozapps/update/tests/chrome/test_0161_check_unsupported.xul
--- a/toolkit/mozapps/update/test/chrome/test_0161_check_unsupported.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0161_check_unsupported.xul
@@ -28,17 +28,17 @@ const TESTS = [ {
 
 function runTest() {
   debugDump("entering");
 
   // When checking manually the unsupported page should still be shown even if
   // it was shown previously.
   Services.prefs.setBoolPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED, true);
 
-  let url = URL_UPDATE + "?unsupported=1";
+  let url = URL_HTTP_UPDATE_XML + "?unsupported=1";
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0162_notify_unsupported.xul
rename to toolkit/mozapps/update/tests/chrome/test_0162_notify_unsupported.xul
--- a/toolkit/mozapps/update/test/chrome/test_0162_notify_unsupported.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0162_notify_unsupported.xul
@@ -22,17 +22,17 @@
 const TESTS = [ {
   pageid: PAGEID_UNSUPPORTED,
   buttonClick: "finish"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?unsupported=1";
+  let url = URL_HTTP_UPDATE_XML + "?unsupported=1";
   setUpdateURLOverride(url);
 
   gAUS.notify(null);
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0900_deprecatedUpdateFormat_minor.xul
rename to toolkit/mozapps/update/tests/chrome/test_0900_deprecatedUpdateFormat_minor.xul
--- a/toolkit/mozapps/update/test/chrome/test_0900_deprecatedUpdateFormat_minor.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0900_deprecatedUpdateFormat_minor.xul
@@ -24,17 +24,18 @@ const TESTS = [ {
 }, {
   pageid: PAGEID_FOUND_BASIC,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?oldFormat=1&type=minor" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?oldFormat=1&type=minor" +
+            getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_0901_deprecatedUpdateFormat_major.xul
rename to toolkit/mozapps/update/tests/chrome/test_0901_deprecatedUpdateFormat_major.xul
--- a/toolkit/mozapps/update/test/chrome/test_0901_deprecatedUpdateFormat_major.xul
+++ b/toolkit/mozapps/update/tests/chrome/test_0901_deprecatedUpdateFormat_major.xul
@@ -33,17 +33,18 @@ const TESTS = [ {
   expectedRemoteContentState: "loaded",
   neverButton: true,
   buttonClick: "extra1"
 } ];
 
 function runTest() {
   debugDump("entering");
 
-  let url = URL_UPDATE + "?oldFormat=1&type=major" + getVersionParams();
+  let url = URL_HTTP_UPDATE_XML + "?oldFormat=1&type=major" +
+            getVersionParams();
   setUpdateURLOverride(url);
 
   gUP.checkForUpdates();
 }
 
 ]]>
 </script>
 
rename from toolkit/mozapps/update/test/chrome/test_9999_cleanup.xul
rename to toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul
rename from toolkit/mozapps/update/test/chrome/update.sjs
rename to toolkit/mozapps/update/tests/chrome/update.sjs
--- a/toolkit/mozapps/update/test/chrome/update.sjs
+++ b/toolkit/mozapps/update/tests/chrome/update.sjs
@@ -9,20 +9,21 @@
  * this file must not use features greater than JavaScript 1.7.
  */
 
 const AUS_Cc = Components.classes;
 const AUS_Ci = Components.interfaces;
 
 #include ../sharedUpdateXML.js
 
-const URL_HOST = "http://example.com/";
-const URL_PATH = "chrome/toolkit/mozapps/update/test/chrome/";
-const URL_UPDATE = URL_HOST + URL_PATH + "update.sjs";
-const SERVICE_URL = URL_HOST + URL_PATH + FILE_SIMPLE_MAR;
+const URL_HOST = "http://example.com";
+const URL_PATH_UPDATE_XML = "/chrome/toolkit/mozapps/update/tests/chrome/update.sjs";
+const URL_HTTP_UPDATE_SJS = URL_HOST + URL_PATH_UPDATE_XML;
+const REL_PATH_DATA = "chrome/toolkit/mozapps/update/tests/data/";
+const SERVICE_URL = URL_HOST + "/" + REL_PATH_DATA + FILE_SIMPLE_MAR;
 
 const SLOW_MAR_DOWNLOAD_INTERVAL = 100;
 var gTimer;
 
 function handleRequest(aRequest, aResponse) {
   var params = { };
   if (aRequest.queryString)
     params = parseQueryString(aRequest.queryString);
@@ -44,17 +45,17 @@ function handleRequest(aRequest, aRespon
   // before the download completes.
   if (params.slowDownloadMar) {
     aResponse.processAsync();
     aResponse.setHeader("Content-Type", "binary/octet-stream");
     aResponse.setHeader("Content-Length", SIZE_SIMPLE_MAR);
     var marFile = AUS_Cc["@mozilla.org/file/directory_service;1"].
                   getService(AUS_Ci.nsIProperties).
                   get("CurWorkD", AUS_Ci.nsILocalFile);
-    var path = URL_PATH + FILE_SIMPLE_MAR;
+    var path = REL_PATH_DATA + FILE_SIMPLE_MAR;
     var pathParts = path.split("/");
     for(var i = 0; i < pathParts.length; ++i)
       marFile.append(pathParts[i]);
     var contents = readFileBytes(marFile);
     gTimer = AUS_Cc["@mozilla.org/timer;1"].
              createInstance(AUS_Ci.nsITimer);
     gTimer.initWithCallback(function(aTimer) {
       aResponse.write(contents);
@@ -112,42 +113,42 @@ function handleRequest(aRequest, aRespon
   var type = params.type ? params.type : "major";
   var name = params.name ? params.name : "App Update Test";
   var appVersion = params.appVersion ? params.appVersion : "99.9";
   var displayVersion = params.displayVersion ? params.displayVersion
                                              : "version " + appVersion;
   var platformVersion = params.platformVersion ? params.platformVersion : "99.8";
   var buildID = params.buildID ? params.buildID : "01234567890123";
   // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244
-//  var detailsURL = params.showDetails ? URL_UPDATE + "?uiURL=DETAILS" : null;
-  var detailsURL = URL_UPDATE + "?uiURL=DETAILS";
-  var billboardURL = params.showBillboard ? URL_UPDATE + "?uiURL=BILLBOARD" : null;
+//  var detailsURL = params.showDetails ? URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS" : null;
+  var detailsURL = URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS";
+  var billboardURL = params.showBillboard ? URL_HTTP_UPDATE_SJS + "?uiURL=BILLBOARD" : null;
   if (billboardURL && params.remoteNoTypeAttr)
     billboardURL += "&amp;remoteNoTypeAttr=1";
   if (params.billboard404)
-    billboardURL = URL_HOST + URL_PATH + "missing.html";
-  var licenseURL = params.showLicense ? URL_UPDATE + "?uiURL=LICENSE" : null;
+    billboardURL = URL_HOST + "/missing.html";
+  var licenseURL = params.showLicense ? URL_HTTP_UPDATE_SJS + "?uiURL=LICENSE" : null;
   if (licenseURL && params.remoteNoTypeAttr)
     licenseURL += "&amp;remoteNoTypeAttr=1";
   if (params.license404)
-    licenseURL = URL_HOST + URL_PATH + "missing.html";
+    licenseURL = URL_HOST + "/missing.html";
   var showPrompt = params.showPrompt ? "true" : null;
   var showNever = params.showNever ? "true" : null;
   var promptWaitTime = params.promptWaitTime ? params.promptWaitTime : null;
   var showSurvey = params.showSurvey ? "true" : null;
 
   // For testing the deprecated update xml format
   if (params.oldFormat) {
     appVersion = null;
     displayVersion = null;
     billboardURL = null;
     showPrompt = null;
     showNever = null;
     showSurvey = null;
-    detailsURL = URL_UPDATE + "?uiURL=BILLBOARD";
+    detailsURL = URL_HTTP_UPDATE_SJS + "?uiURL=BILLBOARD";
     if (params.remoteNoTypeAttr)
       detailsURL += "&amp;remoteNoTypeAttr=1";
     var extensionVersion = params.appVersion ? params.appVersion : "99.9";
     var version = params.displayVersion ? params.displayVersion
                                         : "version " + extensionVersion;
   }
 
   var updates = getRemoteUpdateString(patches, type, "App Update Test",
@@ -229,17 +230,17 @@ function getUpdateRDF(aParams) {
          "  </RDF:Description>\n" +
          "  <RDF:Description about=\"urn:mozilla:extension:" + addonID + ":" + addonVersion + "\">\n" +
          "    <em:version>" + addonVersion + "</em:version>\n" +
          "    <em:targetApplication>\n" +
          "      <RDF:Description>\n" +
          "        <em:id>toolkit@mozilla.org</em:id>\n" +
          "        <em:minVersion>0</em:minVersion>\n" +
          "        <em:maxVersion>" + maxVersion + "</em:maxVersion>\n" +
-         "        <em:updateLink>" + URL_HOST + URL_PATH + "</em:updateLink>\n" +
+         "        <em:updateLink>" + URL_HTTP_UPDATE_SJS + "</em:updateLink>\n" +
          "        <em:updateHash>sha256:0</em:updateHash>\n" + 
          "      </RDF:Description>\n" +
          "    </em:targetApplication>\n" +
          "  </RDF:Description>\n" +
          "</RDF:RDF>\n";
 }
 
 /**
rename from toolkit/mozapps/update/test/chrome/utils.js
rename to toolkit/mozapps/update/tests/chrome/utils.js
--- a/toolkit/mozapps/update/test/chrome/utils.js
+++ b/toolkit/mozapps/update/tests/chrome/utils.js
@@ -134,35 +134,40 @@ const PAGEID_ERRORS           = "errors"
 const PAGEID_ERROR_EXTRA      = "errorextra";            // Done
 const PAGEID_ERROR_PATCHING   = "errorpatching";         // Done
 const PAGEID_FINISHED         = "finished";              // Done
 const PAGEID_FINISHED_BKGRD   = "finishedBackground";    // Done
 const PAGEID_INSTALLED        = "installed";             // Done
 
 const UPDATE_WINDOW_NAME = "Update:Wizard";
 
-const URL_HOST   = "http://example.com";
-const URL_PATH   = "chrome/toolkit/mozapps/update/test/chrome";
-const URL_UPDATE = URL_HOST + "/" + URL_PATH + "/update.sjs";
+const URL_HOST = "http://example.com";
+const URL_PATH_UPDATE_XML = "/chrome/toolkit/mozapps/update/tests/chrome/update.sjs";
+const REL_PATH_DATA = "chrome/toolkit/mozapps/update/tests/data";
+
+const URL_HTTP_UPDATE_XML = URL_HOST + URL_PATH_UPDATE_XML;
+const URL_HTTPS_UPDATE_XML = "https://example.com" + URL_PATH_UPDATE_XML;
 
 const URI_UPDATE_PROMPT_DIALOG  = "chrome://mozapps/content/update/updates.xul";
 
 const ADDON_ID_SUFFIX = "@appupdatetest.mozilla.org";
 const ADDON_PREP_DIR = "appupdateprep";
 // Preference for storing add-ons that are disabled by the tests to prevent them
 // from interefering with the tests.
 const PREF_DISABLEDADDONS = "app.update.test.disabledAddons";
 const PREF_EM_HOTFIX_ID = "extensions.hotfix.id";
 const TEST_ADDONS = [ "appdisabled_1", "appdisabled_2",
                       "compatible_1", "compatible_2",
                       "noupdate_1", "noupdate_2",
                       "updatecompatibility_1", "updatecompatibility_2",
                       "updateversion_1", "updateversion_2",
                       "userdisabled_1", "userdisabled_2", "hotfix" ];
 
+var gURLData = URL_HOST + "/" + REL_PATH_DATA + "/";
+
 var gTestTimeout = 45000; // 45 seconds
 var gTimeoutTimer;
 
 // The number of SimpleTest.executeSoon calls to perform when waiting on an
 // update window to close before giving up.
 const CLOSE_WINDOW_TIMEOUT_MAXCOUNT = 10;
 // Counter for the SimpleTest.executeSoon when waiting on an update window to
 // close before giving up.
@@ -854,18 +859,18 @@ function setupPrefs() {
   if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_STAGING_ENABLED)) {
     gAppUpdateStagingEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_STAGING_ENABLED);
   }
   Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
 
   if (Services.prefs.prefHasUserValue(PREF_EXTENSIONS_UPDATE_URL)) {
     gExtUpdateURL = Services.prefs.getCharPref(PREF_EXTENSIONS_UPDATE_URL);
   }
-  let extUpdateUrl = URL_UPDATE + "?addonID=%ITEM_ID%&platformVersion=" +
-                     getNewerPlatformVersion();
+  let extUpdateUrl = URL_HTTP_UPDATE_XML + "?addonID=%ITEM_ID%" +
+                     "&platformVersion=" + getNewerPlatformVersion();
   Services.prefs.setCharPref(PREF_EXTENSIONS_UPDATE_URL, extUpdateUrl);
 
   Services.prefs.setIntPref(PREF_APP_UPDATE_IDLETIME, 0);
   Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 0);
   Services.prefs.setBoolPref(PREF_EXTENSIONS_STRICT_COMPAT, true);
   Services.prefs.setCharPref(PREF_EM_HOTFIX_ID, "hotfix" + ADDON_ID_SUFFIX);
 }
 
rename from toolkit/mozapps/update/test/unit/data/complete.mar
rename to toolkit/mozapps/update/tests/data/complete.mar
rename from toolkit/mozapps/update/test/unit/data/complete.png
rename to toolkit/mozapps/update/tests/data/complete.png
rename from toolkit/mozapps/update/test/unit/data/complete_cc_log_switch_success
rename to toolkit/mozapps/update/tests/data/complete_cc_log_switch_success
rename from toolkit/mozapps/update/test/unit/data/complete_log_success
rename to toolkit/mozapps/update/tests/data/complete_log_success
rename from toolkit/mozapps/update/test/unit/data/complete_log_switch_success
rename to toolkit/mozapps/update/tests/data/complete_log_switch_success
rename from toolkit/mozapps/update/test/unit/data/complete_precomplete
rename to toolkit/mozapps/update/tests/data/complete_precomplete
rename from toolkit/mozapps/update/test/unit/data/complete_removed-files
rename to toolkit/mozapps/update/tests/data/complete_removed-files
rename from toolkit/mozapps/update/test/unit/data/complete_update_manifest
rename to toolkit/mozapps/update/tests/data/complete_update_manifest
rename from toolkit/mozapps/update/test/unit/data/complete_win.mar
rename to toolkit/mozapps/update/tests/data/complete_win.mar
rename from toolkit/mozapps/update/test/unit/data/old_version_mar.mar
rename to toolkit/mozapps/update/tests/data/old_version.mar
rename from toolkit/mozapps/update/test/unit/data/partial.mar
rename to toolkit/mozapps/update/tests/data/partial.mar
rename from toolkit/mozapps/update/test/unit/data/partial.png
rename to toolkit/mozapps/update/tests/data/partial.png
rename from toolkit/mozapps/update/test/unit/data/partial_in_use_win_after.exe
rename to toolkit/mozapps/update/tests/data/partial_in_use_win_after.exe
rename from toolkit/mozapps/update/test/unit/data/partial_in_use_win_before.exe
rename to toolkit/mozapps/update/tests/data/partial_in_use_win_before.exe
rename from toolkit/mozapps/update/test/unit/data/partial_log_failure
rename to toolkit/mozapps/update/tests/data/partial_log_failure
rename from toolkit/mozapps/update/test/unit/data/partial_log_success
rename to toolkit/mozapps/update/tests/data/partial_log_success
rename from toolkit/mozapps/update/test/unit/data/partial_log_switch_success
rename to toolkit/mozapps/update/tests/data/partial_log_switch_success
rename from toolkit/mozapps/update/test/unit/data/partial_precomplete
rename to toolkit/mozapps/update/tests/data/partial_precomplete
rename from toolkit/mozapps/update/test/unit/data/partial_removed-files
rename to toolkit/mozapps/update/tests/data/partial_removed-files
rename from toolkit/mozapps/update/test/unit/data/partial_update_manifest
rename to toolkit/mozapps/update/tests/data/partial_update_manifest
rename from toolkit/mozapps/update/test/unit/data/partial_win.mar
rename to toolkit/mozapps/update/tests/data/partial_win.mar
rename from toolkit/mozapps/update/test/unit/data/simple.mar
rename to toolkit/mozapps/update/tests/data/simple.mar
rename from toolkit/mozapps/update/test/unit/data/simple_no_pib.mar
rename to toolkit/mozapps/update/tests/data/simple_no_pib.mar
rename from toolkit/mozapps/update/test/unit/data/wrong_product_channel_mar.mar
rename to toolkit/mozapps/update/tests/data/wrong_product_channel.mar
rename from toolkit/mozapps/update/test/marionette/data/bad.xml
rename to toolkit/mozapps/update/tests/marionette/data/bad.xml
rename from toolkit/mozapps/update/test/marionette/data/err.cgi
rename to toolkit/mozapps/update/tests/marionette/data/err.cgi
rename from toolkit/mozapps/update/test/marionette/update-smoketests.ini
rename to toolkit/mozapps/update/tests/marionette/update-smoketests.ini
rename from toolkit/mozapps/update/test/marionette/update-tests.ini
rename to toolkit/mozapps/update/tests/marionette/update-tests.ini
rename from toolkit/mozapps/update/test/marionette/update_smoketest_ota_same_version.js
rename to toolkit/mozapps/update/tests/marionette/update_smoketest_ota_same_version.js
rename from toolkit/mozapps/update/test/marionette/update_smoketest_ota_same_version.py
rename to toolkit/mozapps/update/tests/marionette/update_smoketest_ota_same_version.py
rename from toolkit/mozapps/update/test/marionette/update_smoketest_ota_simple.js
rename to toolkit/mozapps/update/tests/marionette/update_smoketest_ota_simple.js
rename from toolkit/mozapps/update/test/marionette/update_smoketest_ota_simple.py
rename to toolkit/mozapps/update/tests/marionette/update_smoketest_ota_simple.py
rename from toolkit/mozapps/update/test/marionette/update_test_ota_simple.js
rename to toolkit/mozapps/update/tests/marionette/update_test_ota_simple.js
rename from toolkit/mozapps/update/test/marionette/update_test_ota_simple.py
rename to toolkit/mozapps/update/tests/marionette/update_test_ota_simple.py
rename from toolkit/mozapps/update/test/marionette/update_test_status.js
rename to toolkit/mozapps/update/tests/marionette/update_test_status.js
rename from toolkit/mozapps/update/test/marionette/update_test_status.py
rename to toolkit/mozapps/update/tests/marionette/update_test_status.py
rename from toolkit/mozapps/update/test/moz.build
rename to toolkit/mozapps/update/tests/moz.build
--- a/toolkit/mozapps/update/test/moz.build
+++ b/toolkit/mozapps/update/tests/moz.build
@@ -1,24 +1,28 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+XPCSHELL_TESTS_MANIFESTS += ['unit_aus_update/xpcshell.ini']
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
-    DIRS += ['chrome']
+    MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
+    XPCSHELL_TESTS_MANIFESTS += ['unit_base_updater/xpcshell.ini']
+
+    if CONFIG['MOZ_MAINTENANCE_SERVICE']:
+        XPCSHELL_TESTS_MANIFESTS += ['unit_service_updater/xpcshell.ini']
 
     sources = [
         'TestAUSHelper',
         'TestAUSReadStrings',
     ]
 
     SOURCES += [
         '%s.cpp' % s for s in sources
     ]
 
     bin_suffix = CONFIG['BIN_SUFFIX']
     SIMPLE_PROGRAMS += [
         '%s%s' % (s, bin_suffix) for s in sources
     ]
-
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
rename from toolkit/mozapps/update/test/shared.js
rename to toolkit/mozapps/update/tests/shared.js
rename from toolkit/mozapps/update/test/sharedUpdateXML.js
rename to toolkit/mozapps/update/tests/sharedUpdateXML.js
--- a/toolkit/mozapps/update/test/sharedUpdateXML.js
+++ b/toolkit/mozapps/update/tests/sharedUpdateXML.js
@@ -45,18 +45,16 @@ const STATE_PENDING         = "pending";
 const STATE_PENDING_SVC     = "pending-service";
 const STATE_APPLYING        = "applying";
 const STATE_APPLIED         = "applied";
 const STATE_APPLIED_SVC     = "applied-service";
 const STATE_SUCCEEDED       = "succeeded";
 const STATE_DOWNLOAD_FAILED = "download-failed";
 const STATE_FAILED          = "failed";
 
-var gTestserverPort;
-
 /**
  * Constructs a string representing a remote update xml file.
  *
  * @param  aUpdates
  *         The string representing the update elements.
  * @return The string representing a remote update xml file.
  */
 function getRemoteUpdatesXMLString(aUpdates) {
@@ -301,18 +299,17 @@ function getUpdateString(aType, aName, a
                                         : DEFAULT_UPDATE_VERSION) + "\" ";
   }
   let buildID = aBuildID ? aBuildID : "20080811053724";
   // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244
 //   let detailsURL = aDetailsURL ? "detailsURL=\"" + aDetailsURL + "\" " : "";
   let detailsURL = "detailsURL=\"" +
                    (aDetailsURL ? aDetailsURL
                                 : "http://test_details/") + "\" ";
-  let billboardURL = aBillboardURL ? "billboardURL=\"" +
-                                     aBillboardURL + "\" "
+  let billboardURL = aBillboardURL ? "billboardURL=\"" + aBillboardURL + "\" "
                                    : "";
   let licenseURL = aLicenseURL ? "licenseURL=\"" + aLicenseURL + "\" " : "";
   let showPrompt = aShowPrompt ? "showPrompt=\"" + aShowPrompt + "\" " : "";
   let showNeverForVersion = aShowNeverForVersion ? "showNeverForVersion=\"" +
                                                    aShowNeverForVersion + "\" "
                                                  : "";
   let promptWaitTime = aPromptWaitTime ? "promptWaitTime=\"" + aPromptWaitTime +
                                          "\" "
@@ -341,36 +338,33 @@ function getUpdateString(aType, aName, a
  * Constructs a string representing a patch element for an update xml file.
  *
  * @param  aType (optional)
  *         The patch's type which should be complete or partial.
  *         If not specified it will default to 'complete'.
  * @param  aURL (optional)
  *         The patch's url to the mar file.
  *         If not specified it will default to the value of:
- *         URL_HOST + (gTestserverPort ? ":" + gTestserverPort : "") + "/" +
- *         URL_PATH + "/" + FILE_SIMPLE_MAR
+ *         gURLData + FILE_SIMPLE_MAR
  * @param  aHashFunction (optional)
  *         The patch's hash function used to verify the mar file.
  *         If not specified it will default to 'MD5'.
  * @param  aHashValue (optional)
  *         The patch's hash value used to verify the mar file.
  *         If not specified it will default to the value of MD5_HASH_SIMPLE_MAR
  *         which is the MD5 hash value for the file specified by FILE_SIMPLE_MAR.
  * @param  aSize (optional)
  *         The patch's file size for the mar file.
  *         If not specified it will default to the file size for FILE_SIMPLE_MAR
  *         specified by SIZE_SIMPLE_MAR.
  * @return The string representing a patch element for an update xml file.
  */
 function getPatchString(aType, aURL, aHashFunction, aHashValue, aSize) {
   let type = aType ? aType : "complete";
-  let url = aURL ? aURL : URL_HOST +
-                          (gTestserverPort ? ":" + gTestserverPort : "") +
-                          "/" + URL_PATH + "/" + FILE_SIMPLE_MAR;
+  let url = aURL ? aURL : gURLData + FILE_SIMPLE_MAR;
   let hashFunction = aHashFunction ? aHashFunction : "MD5";
   let hashValue = aHashValue ? aHashValue : MD5_HASH_SIMPLE_MAR;
   let size = aSize ? aSize : SIZE_SIMPLE_MAR;
   return "    <patch type=\"" + type + "\" " +
                      "URL=\"" + url + "\" " +
                      "hashFunction=\"" + hashFunction + "\" " +
                      "hashValue=\"" + hashValue + "\" " +
                      "size=\"" + size + "\"";
rename from toolkit/mozapps/update/test/unit/test_0010_general.js
rename to toolkit/mozapps/update/tests/unit_aus_update/canCheckForAndCanApplyUpdates.js
--- a/toolkit/mozapps/update/test/unit/test_0010_general.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/canCheckForAndCanApplyUpdates.js
@@ -1,40 +1,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General Update Service Tests */
-
-const TEST_ID = "0010";
-
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   // Verify write access to the custom app dir
   logTestInfo("testing write access to the application directory");
-  removeUpdateDirsAndFiles();
   var testFile = getCurrentProcessDir();
   testFile.append("update_write_access_test");
   testFile.create(AUS_Ci.nsIFile.NORMAL_FILE_TYPE, 0644);
   do_check_true(testFile.exists());
   testFile.remove(false);
   do_check_false(testFile.exists());
 
   standardInit();
 
   // Check if available updates can be checked for
   logTestInfo("testing nsIApplicationUpdateService:canCheckForUpdates");
   do_check_true(gAUS.canCheckForUpdates);
   // Check if updates can be applied
   logTestInfo("testing nsIApplicationUpdateService:canApplyUpdates");
   do_check_true(gAUS.canApplyUpdates);
-
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0063_manager.js
rename to toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForDifferentChannel.js
--- a/toolkit/mozapps/update/test/unit/test_0063_manager.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForDifferentChannel.js
@@ -1,29 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 /* General Update Manager Tests */
 
-const TEST_ID = "0063";
-
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   logTestInfo("testing removal of an active update for a channel that is not" +
-              "valid due to switching channels (bug 486275)");
-  removeUpdateDirsAndFiles();
+              "valid due to switching channels (Bug 486275).");
 
   var patches, updates, update;
-
   patches = getLocalPatchString(null, null, null, null, null, null,
                                 STATE_DOWNLOADING);
   updates = getLocalUpdateString(patches, null, null, "version 1.0", "1.0");
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeStatusFile(STATE_DOWNLOADING);
 
   patches = getLocalPatchString(null, null, null, null, null, null,
                                 STATE_FAILED);
@@ -46,10 +39,10 @@ function run_test() {
   file = getUpdatesXMLFile(true);
   logTestInfo("verifying contents of " + FILE_UPDATE_ACTIVE);
   do_check_eq(readFile(file), getLocalUpdatesXMLString(""));
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0061_manager.js
rename to toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js
--- a/toolkit/mozapps/update/test/unit/test_0061_manager.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js
@@ -1,26 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General Update Manager Tests */
-
-const TEST_ID = "0061";
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  logTestInfo("testing removal of an update download in progress for an " +
-              "older version of the application on startup (bug 485624)");
-  removeUpdateDirsAndFiles();
+  logTestInfo("testing cleanup of an update download in progress for an " +
+              "older version of the application on startup (Bug 485624)");
 
   var patches, updates;
 
   patches = getLocalPatchString(null, null, null, null, null, null,
                                 STATE_DOWNLOADING);
   updates = getLocalUpdateString(patches, null, null, "version 0.9", "0.9");
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeStatusFile(STATE_DOWNLOADING);
@@ -38,10 +31,10 @@ function run_test() {
     do_check_eq(gUpdateManager.activeUpdate, null);
   }
   do_check_eq(gUpdateManager.updateCount, 0);
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0064_manager.js
rename to toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForSameVersionAndBuildID.js
--- a/toolkit/mozapps/update/test/unit/test_0064_manager.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForSameVersionAndBuildID.js
@@ -1,27 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General Update Manager Tests */
-
-const TEST_ID = "0064";
-
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   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)");
-  removeUpdateDirsAndFiles();
+              "build id on startup (Bug 536547)");
 
   var patches, updates;
 
   patches = getLocalPatchString(null, null, null, null, null, null,
                                 STATE_DOWNLOADING);
   updates = getLocalUpdateString(patches, null, null, "version 1.0", "1.0", null,
                                  "2007010101");
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
@@ -40,10 +32,10 @@ function run_test() {
     do_check_eq(gUpdateManager.activeUpdate, null);
   }
   do_check_eq(gUpdateManager.updateCount, 0);
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0072_update_dir_cleanup.js
rename to toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingIncorrectStatus.js
--- a/toolkit/mozapps/update/test/unit/test_0072_update_dir_cleanup.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingIncorrectStatus.js
@@ -1,23 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* General Update Directory Cleanup Tests - Bug 539717 */
-
-const TEST_ID = "0072";
+function run_test() {
+  setupTestCommon(true);
 
-function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  removeUpdateDirsAndFiles();
+  logTestInfo("testing update cleanup when reading the status file returns " +
+              "STATUS_NONE and the update xml has an update with " +
+              "STATE_DOWNLOADING (Bug 539717).");
 
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
   var patches = getLocalPatchString(null, null, null, null, null, null,
                                     STATE_DOWNLOADING);
   var updates = getLocalUpdateString(patches);
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeStatusFile(STATE_NONE);
 
@@ -28,17 +23,19 @@ function run_test() {
   logTestInfo("testing " + dir.path + " should exist");
   do_check_true(dir.exists());
 
   var statusFile = dir.clone();
   statusFile.append(FILE_UPDATE_STATUS);
   logTestInfo("testing " + statusFile.path + " should not exist");
   do_check_false(statusFile.exists());
 
+  logTestInfo("testing activeUpdate == null");
   do_check_eq(gUpdateManager.activeUpdate, null);
+  logTestInfo("testing updateCount == 0");
   do_check_eq(gUpdateManager.updateCount, 0);
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0073_update_dir_cleanup.js
rename to toolkit/mozapps/update/tests/unit_aus_update/cleanupPendingVersionFileIncorrectStatus.js
--- a/toolkit/mozapps/update/test/unit/test_0073_update_dir_cleanup.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/cleanupPendingVersionFileIncorrectStatus.js
@@ -1,46 +1,43 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* General Update Directory Cleanup Tests - Bug 601701 */
-
-const TEST_ID = "0073";
+function run_test() {
+  setupTestCommon(true);
 
-function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  removeUpdateDirsAndFiles();
+  logTestInfo("testing update cleanup when reading the status file returns " +
+              "STATUS_NONE, the version file is for a newer version, and the " +
+              "update xml has an update with STATE_PENDING (Bug 601701).");
 
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
   var patches = getLocalPatchString(null, null, null, null, null, null,
                                     STATE_PENDING);
   var updates = getLocalUpdateString(patches);
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeVersionFile("99.9");
 
   standardInit();
 
   // Check that there is no activeUpdate first so the updates directory is
-  // cleaned before the remaining tests.
+  // cleaned up by the UpdateManager before the remaining tests.
+  logTestInfo("testing activeUpdate == null");
   do_check_eq(gUpdateManager.activeUpdate, null);
+  logTestInfo("testing updateCount == 0");
   do_check_eq(gUpdateManager.updateCount, 0);
 
   var dir = getUpdatesDir();
   dir.append("0");
   logTestInfo("testing " + dir.path + " should exist");
   do_check_true(dir.exists());
 
   var versionFile = dir.clone();
   versionFile.append(FILE_UPDATE_VERSION);
   logTestInfo("testing " + versionFile.path + " should not exist");
   do_check_false(versionFile.exists());
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0070_update_dir_cleanup.js
rename to toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogMove.js
--- a/toolkit/mozapps/update/test/unit/test_0070_update_dir_cleanup.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogMove.js
@@ -1,24 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General Update Directory Cleanup Tests */
-
-const TEST_ID = "0070";
+function run_test() {
+  setupTestCommon(true);
 
-function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  removeUpdateDirsAndFiles();
+  logTestInfo("testing that the update.log is moved after a successful update");
 
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
   var patches = getLocalPatchString(null, null, null, null, null, null,
                                     STATE_PENDING);
   var updates = getLocalUpdateString(patches);
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeStatusFile(STATE_SUCCEEDED);
 
@@ -49,10 +42,10 @@ function run_test() {
   dir.append("0");
   logTestInfo("testing " + dir.path + " should exist (bug 512994)");
   do_check_true(dir.exists());
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0071_update_dir_cleanup.js
rename to toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogsFIFO.js
--- a/toolkit/mozapps/update/test/unit/test_0071_update_dir_cleanup.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogsFIFO.js
@@ -1,24 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General Update Directory Cleanup Tests */
-
-const TEST_ID = "0071";
+function run_test() {
+  setupTestCommon(true);
 
-function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  removeUpdateDirsAndFiles();
+  logTestInfo("testing update logs are first in first out deleted");
 
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
   var patches = getLocalPatchString(null, null, null, null, null, null,
                                     STATE_PENDING);
   var updates = getLocalUpdateString(patches);
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeStatusFile(STATE_SUCCEEDED);
 
@@ -60,10 +53,10 @@ function run_test() {
   dir.append("0");
   logTestInfo("testing " + dir.path + " should exist (bug 512994)");
   do_check_true(dir.exists());
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_bug595059.js
rename to toolkit/mozapps/update/tests/unit_aus_update/downloadCompleteAfterPartialFailure.js
--- a/toolkit/mozapps/update/test/unit/test_bug595059.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/downloadCompleteAfterPartialFailure.js
@@ -1,42 +1,31 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/**
- * Bug 595059 - begin download of a complete update after a failure applying a
- * partial update.
- */
-
-const TEST_ID = "bug595059";
-
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls 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 +
-              " and the update.errorCode = " + WRITE_ERROR);
-
-  removeUpdateDirsAndFiles();
+  logTestInfo("testing download a complete on partial failure. Calling " +
+              "nsIUpdatePrompt::showUpdateError should call getNewPrompter " +
+              "and alert on the object returned by getNewPrompter when the " +
+              "update.state == " + STATE_FAILED + " and the update.errorCode " +
+              "== " + WRITE_ERROR + " (Bug 595059).");
 
   let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
   registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                             "Fake Window Watcher",
                             "@mozilla.org/embedcomp/window-watcher;1",
                             WindowWatcherFactory);
 
   standardInit();
 
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
-  let url = URL_HOST + URL_PATH + "/complete.mar";
+  let url = URL_HOST + "/" + FILE_COMPLETE_MAR;
   let patches = getLocalPatchString("complete", url, null, null, null, null,
                                     STATE_FAILED);
   let updates = getLocalUpdateString(patches, null, null, "version 1.0", "1.0",
                                      null, null, null, null, url);
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeStatusFile(STATE_FAILED);
 
   reloadUpdateManagerData();
@@ -47,17 +36,17 @@ function run_test() {
                  createInstance(AUS_Ci.nsIUpdatePrompt);
   prompter.showUpdateError(update);
 }
 
 function end_test() {
   let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
   registrar.unregisterFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                               WindowWatcherFactory);
-  cleanUp();
+  cleanupTestCommon();
 }
 
 var WindowWatcher = {
   getNewPrompter: function(aParent) {
     do_check_eq(aParent, null);
     return {
       alert: function(aTitle, aText) {
         let title = getString("updaterIOErrorTitle");
rename from toolkit/mozapps/update/test/unit/test_bug833708.js
rename to toolkit/mozapps/update/tests/unit_aus_update/downloadFileTooBig_gonk.js
--- a/toolkit/mozapps/update/test/unit/test_bug833708.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/downloadFileTooBig_gonk.js
@@ -1,16 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-AUS_Cu.import("resource://gre/modules/FileUtils.jsm");
-
-const TEST_ID = "bug794211";
 const KEY_UPDATE_ARCHIVE_DIR = "UpdArchD"
 
 let gActiveUpdate = null;
 
 function FakeDirProvider() {}
 FakeDirProvider.prototype = {
   classID: Components.ID("{f30b43a7-2bfa-4e5f-8c4f-abc7dd4ac486}"),
   QueryInterface: XPCOMUtils.generateQI([AUS_Ci.nsIDirectoryServiceProvider]),
@@ -21,29 +18,24 @@ FakeDirProvider.prototype = {
         gActiveUpdate.errorCode = AUS_Cr.NS_ERROR_FILE_TOO_BIG;
       }
     }
     return null;
   }
 };
 
 function run_test() {
-  do_test_pending();
-  DEBUG_AUS_TEST = true;
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  removeUpdateDirsAndFiles();
   setUpdateURLOverride();
   overrideXHR(xhr_pt1);
   standardInit();
 
   logTestInfo("testing that error codes set from a directory provider propagate" +
-              "up to AUS.downloadUpdate() correctly");
+              "up to AUS.downloadUpdate() correctly (Bug 794211).");
 
   gDirProvider = new FakeDirProvider();
   gOldProvider = AUS_Cc["@mozilla.org/browser/directory-provider;1"]
                        .createInstance(AUS_Ci.nsIDirectoryServiceProvider);
 
   gDirService = AUS_Cc["@mozilla.org/file/directory_service;1"]
                        .getService(AUS_Ci.nsIProperties);
 
@@ -95,10 +87,10 @@ function check_test_pt1() {
 
 function end_test() {
   gDirService.unregisterProvider(gDirProvider);
   gDirService.registerProvider(gOldProvider);
   gActiveUpdate = null;
   gDirService = null;
   gDirProvider = null;
 
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_bug794211.js
rename to toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedByOfflineRetry.js
--- a/toolkit/mozapps/update/test/unit/test_bug794211.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedByOfflineRetry.js
@@ -1,30 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* Offline retry test (Bug 794211) */
-
-const TEST_ID = "bug794211";
-
 // Needs to be in sync w/ nsUpdateService.js
 const NETWORK_ERROR_OFFLINE = 111;
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
-  logTestInfo("test when an update check fails because the network is " +
-              "offline that we check again when the network comes online. " +
-              "(Bug 794211)");
-  removeUpdateDirsAndFiles();
+  logTestInfo("testing when an update check fails because the network is " +
+              "offline that we check again when the network comes online " +
+              "(Bug 794211).");
+
   setUpdateURLOverride();
   Services.prefs.setBoolPref(PREF_APP_UPDATE_AUTO, false);
 
   overrideXHR(null);
   overrideUpdatePrompt(updatePrompt);
   standardInit();
 
   do_execute_soon(run_test_pt1);
@@ -80,10 +73,10 @@ function check_test_pt2(update) {
   // We just verify that there are updates to know the check succeeded.
   do_check_neq(update, null);
   do_check_eq(update.name, "App Update Test");
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0030_general.js
rename to toolkit/mozapps/update/tests/unit_aus_update/downloadMar.js
--- a/toolkit/mozapps/update/test/unit/test_0030_general.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/downloadMar.js
@@ -1,56 +1,50 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 /* 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");
-AUS_Cu.import("resource://gre/modules/XPCOMUtils.jsm")
 
 var gNextRunFunc;
 var gStatusResult;
 var gExpectedStatusResult;
 var gIncrementalDownloadClassID, gIncOldFactory;
 
 // gIncrementalDownloadErrorType is used to loop through each of the connection
 // error types in the Mock incremental downloader.
 var gIncrementalDownloadErrorType = 0;
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  logTestInfo("testing mar downloads, mar hash verification, and " +
+              "mar download interrupted recovery");
 
   Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
-  removeUpdateDirsAndFiles();
   // The HTTP server is only used for the mar file downloads since it is slow
-  start_httpserver(URL_PATH);
-  setUpdateURLOverride(URL_HOST + ":" + gTestserverPort + "/update.xml");
+  start_httpserver();
+  setUpdateURLOverride(gURLData + "update.xml");
   // The mock XMLHttpRequest is MUCH faster
   overrideXHR(callHandleEvent);
   standardInit();
   do_execute_soon(run_test_pt1);
 }
 
 // The HttpServer must be stopped before calling do_test_finished
 function finish_test() {
   stop_httpserver(do_test_finished);
 }
 
 function end_test() {
   cleanupMockIncrementalDownload();
-  cleanUp();
+  cleanupTestCommon();
 }
 
 // Callback function used by the custom XMLHttpRequest implementation to
 // call the nsIDOMEventListener's handleEvent method for onload.
 function callHandleEvent() {
   gXHR.status = 400;
   gXHR.responseText = gResponseBody;
   try {
@@ -201,18 +195,17 @@ function run_test_pt9() {
 function run_test_pt10() {
   setResponseBody("SHA512", SHA512_HASH_SIMPLE_MAR + "0");
   run_test_helper_pt1("mar download with an invalid SHA512 hash",
                       AUS_Cr.NS_ERROR_CORRUPTED_CONTENT, run_test_pt11);
 }
 
 // mar download with the mar not found
 function run_test_pt11() {
-  var patches = getRemotePatchString(null, URL_HOST + ":" + gTestserverPort +
-                                     "/" + URL_PATH + "/missing.mar");
+  var patches = getRemotePatchString(null, gURLData + "missing.mar");
   var updates = getRemoteUpdateString(patches);
   gResponseBody = getRemoteUpdatesXMLString(updates);
   run_test_helper_pt1("mar download with the mar not found",
                       AUS_Cr.NS_ERROR_UNEXPECTED, run_test_pt12);
 }
 
 // mar download with a valid MD5 hash but invalid file size
 function run_test_pt12() {
@@ -249,18 +242,16 @@ function initMockIncrementalDownload() {
   var registrar = AUS_Cm.QueryInterface(AUS_Ci.nsIComponentRegistrar);
   gIncrementalDownloadClassID = registrar.contractIDToCID(INC_CONTRACT_ID);
   gIncOldFactory = AUS_Cm.getClassObject(AUS_Cc[INC_CONTRACT_ID],
                                          AUS_Ci.nsIFactory);
   registrar.unregisterFactory(gIncrementalDownloadClassID, gIncOldFactory);
   var components = [IncrementalDownload];
   registrar.registerFactory(gIncrementalDownloadClassID, "",
                             INC_CONTRACT_ID, newFactory);
-  gIncOldFactory = AUS_Cm.getClassObject(AUS_Cc[INC_CONTRACT_ID],
-                                         AUS_Ci.nsIFactory);
 }
 
 function cleanupMockIncrementalDownload() {
   if (gIncOldFactory) {
     var registrar = AUS_Cm.QueryInterface(AUS_Ci.nsIComponentRegistrar);
     registrar.unregisterFactory(gIncrementalDownloadClassID, newFactory);
     registrar.registerFactory(gIncrementalDownloadClassID, "",
                               INC_CONTRACT_ID, gIncOldFactory);
@@ -292,17 +283,17 @@ IncrementalDownload.prototype = {
     var tm = Components.classes["@mozilla.org/thread-manager;1"].
                         getService(AUS_Ci.nsIThreadManager);
     // Do the actual operation async to give a chance for observers
     // to add themselves.
     tm.mainThread.dispatch(function() {
         this._observer = observer.QueryInterface(AUS_Ci.nsIRequestObserver);
         this._ctxt = ctxt;
         this._observer.onStartRequest(this, this.ctxt);
-        let mar = do_get_file("data/" + FILE_SIMPLE_MAR);
+        let mar = getTestDirFile(FILE_SIMPLE_MAR);
         mar.copyTo(this._destination.parent, this._destination.leafName);
         var status = AUS_Cr.NS_OK
         switch (gIncrementalDownloadErrorType++) {
           case 0:
             status = AUS_Cr.NS_ERROR_NET_RESET;
           break;
           case 1:
             status = AUS_Cr.NS_ERROR_CONNECTION_REFUSED;
rename from toolkit/mozapps/update/test/unit/test_0062_manager.js
rename to toolkit/mozapps/update/tests/unit_aus_update/downloadResumeForSameAppVersion.js
--- a/toolkit/mozapps/update/test/unit/test_0062_manager.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/downloadResumeForSameAppVersion.js
@@ -1,26 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General Update Manager Tests */
-
-const TEST_ID = "0062";
-
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   logTestInfo("testing resuming an update download in progress for the same " +
-              "version of the application on startup (bug 485624)");
-  removeUpdateDirsAndFiles();
+              "version of the application on startup (Bug 485624)");
 
   var patches, updates;
 
   patches = getLocalPatchString(null, null, null, null, null, null,
                                 STATE_DOWNLOADING);
   updates = getLocalUpdateString(patches, null, null, "1.0", "1.0");
   writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
   writeStatusFile(STATE_DOWNLOADING);
@@ -37,10 +29,10 @@ function run_test() {
     do_check_eq(gUpdateManager.updateCount, 1);
   }
   do_check_eq(gUpdateManager.activeUpdate.state, STATE_DOWNLOADING);
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/head_update.js.in
rename to toolkit/mozapps/update/tests/unit_aus_update/head_update.js
--- a/toolkit/mozapps/update/test/unit/head_update.js.in
+++ b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
@@ -60,72 +60,82 @@ const USE_EXECV = IS_UNIX && !IS_MACOSX;
 
 #ifdef MOZ_VERIFY_MAR_SIGNATURE
 const IS_MAR_CHECKS_ENABLED = true;
 #else
 const IS_MAR_CHECKS_ENABLED = false;
 #endif
 
 const URL_HOST = "http://localhost";
-const URL_PATH = "data";
 
 const APPLY_TO_DIR_SUFFIX = "_applyToDir/";
+const UPDATES_DIR_SUFFIX = "_mar";
 #ifdef XP_MACOSX
 const UPDATED_DIR_SUFFIX = "Updated.app/";
 #else
 const UPDATED_DIR_SUFFIX = "updated/";
 #endif
-const HELPER_BIN_FILE = "TestAUSHelper" + BIN_SUFFIX;
-const MAR_COMPLETE_FILE = "data/complete.mar";
-const MAR_PARTIAL_FILE = "data/partial.mar";
-const MAR_OLD_VERSION_FILE = "data/old_version_mar.mar";
-const MAR_WRONG_CHANNEL_FILE = "data/wrong_product_channel_mar.mar";
-const UPDATER_BIN_FILE = "updater" + BIN_SUFFIX;
-const MAINTENANCE_SERVICE_BIN_FILE = "maintenanceservice.exe";
-const MAINTENANCE_SERVICE_INSTALLER_BIN_FILE = "maintenanceservice_installer.exe";
-const UPDATES_DIR_SUFFIX = "_mar";
 
-const LOG_COMPLETE_SUCCESS = "data/complete_log_success";
-const LOG_COMPLETE_SWITCH_SUCCESS = "data/complete_log_switch_success"
-const LOG_COMPLETE_CC_SUCCESS = "data/complete_cc_log_success";
-const LOG_COMPLETE_CC_SWITCH_SUCCESS = "data/complete_cc_log_switch_success";
+const FILE_COMPLETE_MAR = "complete.mar";
+const FILE_COMPLETE_WIN_MAR = "complete_win.mar";
+const FILE_HELPER_BIN = "TestAUSHelper" + BIN_SUFFIX;
+const FILE_MAINTENANCE_SERVICE_BIN = "maintenanceservice.exe";
+const FILE_MAINTENANCE_SERVICE_INSTALLER_BIN = "maintenanceservice_installer.exe";
+const FILE_OLD_VERSION_MAR = "old_version.mar";
+const FILE_PARTIAL_MAR = "partial.mar";
+const FILE_PARTIAL_WIN_MAR = "partial_win.mar";
+const FILE_UPDATER_BIN = "updater" + BIN_SUFFIX;
+const FILE_UPDATER_INI_BAK = "updater.ini.bak";
+const FILE_WRONG_CHANNEL_MAR = "wrong_product_channel.mar";
 
-const LOG_PARTIAL_SUCCESS = "data/partial_log_success";
-const LOG_PARTIAL_SWITCH_SUCCESS = "data/partial_log_switch_success";
-const LOG_PARTIAL_FAILURE = "data/partial_log_failure";
+const LOG_COMPLETE_SUCCESS = "complete_log_success";
+const LOG_COMPLETE_SWITCH_SUCCESS = "complete_log_switch_success"
+const LOG_COMPLETE_CC_SUCCESS = "complete_cc_log_success";
+const LOG_COMPLETE_CC_SWITCH_SUCCESS = "complete_cc_log_switch_success";
+
+const LOG_PARTIAL_SUCCESS = "partial_log_success";
+const LOG_PARTIAL_SWITCH_SUCCESS = "partial_log_switch_success";
+const LOG_PARTIAL_FAILURE = "partial_log_failure";
 
 const ERR_CALLBACK_FILE_IN_USE = "NS_main: file in use - failed to " +
                                  "exclusively open executable file:"
 
 const ERR_RENAME_FILE = "rename_file: failed to rename file";
 const ERR_UNABLE_OPEN_DEST = "unable to open destination file";
 const ERR_BACKUP_DISCARD = "backup_discard: unable to remove";
 
 const LOG_SVC_SUCCESSFUL_LAUNCH = "Process was started... waiting on result.";
 
-// variables are used instead of contants so tests can override these values
-var gCallbackBinFile = "callback_app" + BIN_SUFFIX;
-var gCallbackArgs = ["./", "callback.log", "Test Arg 2", "Test Arg 3"];
-var gBackgroundUpdate = false;
-var gSwitchApp = false;
-var gDisableReplaceFallback = false;
+// All we care about is that the last modified time has changed so that Mac OS
+// X Launch Services invalidates its cache so the test allows up to one minute
+// difference in the last modified time.
+const MAC_MAX_TIME_DIFFERENCE = 60000;
 
 // Time to wait for the test helper process before continuing the test
 const TEST_HELPER_TIMEOUT = 100;
 
 // Time to wait for a check in the test before continuing the test
 const TEST_CHECK_TIMEOUT = 100;
 
 // How many of TEST_CHECK_TIMEOUT to wait before we abort the test.
 const MAX_TIMEOUT_RUNS = 1000;
 
+// Maximum number of milliseconds the process that is launched can run before
+// the test will try to kill it.
+const APP_TIMER_TIMEOUT = 120000;
+
 // 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";
 
+// This default value will be overridden when using the http server.
+var gURLData = URL_HOST + "/";
+
+var gTestID;
+
 var gTestserver;
 
 var gXHR;
 var gXHRCallback;
 
 var gUpdatePrompt;
 var gUpdatePromptCallback;
 
@@ -133,16 +143,25 @@ var gCheckFunc;
 var gResponseBody;
 var gResponseStatusCode = 200;
 var gRequestURL;
 var gUpdateCount;
 var gUpdates;
 var gStatusCode;
 var gStatusText;
 
+// Variables are used instead of contants so tests can override these values
+var gCallbackBinFile = "callback_app" + BIN_SUFFIX;
+var gCallbackArgs = ["./", "callback.log", "Test Arg 2", "Test Arg 3"];
+var gBackgroundUpdate = false;
+var gSwitchApp = false;
+var gDisableReplaceFallback = false;
+
+var gTimeoutRuns = 0;
+
 /**
  * The mar files used for the updater tests contain the following remove
  * operations.
  *
  * partial and complete test mar remove operations
  * -----------------------------------------------
  * remove "text1"
  * remove "text0"
@@ -315,20 +334,38 @@ if (APP_BIN_NAME == "xulrunner") {
   try {
     gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
   }
   catch (e) {
     setUpdateChannel("test_channel");
   }
 }
 
+function setupTestCommon(aAdjustGeneralPaths) {
+  do_test_pending();
+
+  if (gTestID) {
+    do_throw("should only be called once!");
+  }
+
+  let caller = Components.stack.caller;
+  gTestID = caller.filename.toString().split("/").pop().split(".")[0];
+
+  if (aAdjustGeneralPaths) {
+     // adjustGeneralPaths registers a cleanup function that calls end_test.
+     adjustGeneralPaths();
+  }
+
+  removeUpdateDirsAndFiles();
+}
+
 /**
  * Nulls out the most commonly used global vars used by tests as appropriate.
  */
-function cleanUp() {
+function cleanupTestCommon() {
   logTestInfo("start - general test cleanup");
   removeUpdateDirsAndFiles();
 
   // Force the update manager to reload the update data to prevent it from
   // writing the old data to the files that have just been removed.
   reloadUpdateManagerData();
 
   if (gChannel) {
@@ -396,36 +433,59 @@ function pathHandler(metadata, response)
  * The main files in the update are located two directories below the apply to
  * directory since Mac OS X sets the last modified time for the root directory
  * to the current time and if the update changes any files in the root directory
  * then it wouldn't be possible to test (bug 600098).
  *
  * @return  The relative path to the directory where the update will be applied.
  */
 function getApplyDirPath() {
-  return TEST_ID + APPLY_TO_DIR_SUFFIX + "appdir/";
+  return gTestID + APPLY_TO_DIR_SUFFIX + "appdir/";
 }
 
 /**
- * Helper function for getting the nsIFile for the directory where the update
- * will be applied.
+ * Helper function for getting the nsIFile for a file in the directory where the
+ * update will be applied.
  *
- * The main files in the update are located two directories below the apply to
+ * The files for the update are located two directories below the apply to
  * directory since Mac OS X sets the last modified time for the root directory
  * to the current time and if the update changes any files in the root directory
  * then it wouldn't be possible to test (bug 600098).
  *
- * @return  The nsIFile for the directory where the update will be applied.
+ * @return  The nsIFile for the file in the directory where the update will be
+ *          applied.
  */
 function getApplyDirFile(aRelPath, allowNonexistent) {
   let relpath = getApplyDirPath() + (aRelPath ? aRelPath : "");
   return do_get_file(relpath, allowNonexistent);
 }
 
 /**
+ * Helper function for getting the relative path to the directory where the
+ * test data files are located.
+ *
+ * @return  The relative path to the directory where the test data files are
+ *          located.
+ */
+function getTestDirPath() {
+  return "../data/";
+}
+
+/**
+ * Helper function for getting the nsIFile for a file in the test data
+ * directory.
+ *
+ * @return  The nsIFile for the file in the test data directory.
+ */
+function getTestDirFile(aRelPath) {
+  let relpath = getTestDirPath() + (aRelPath ? aRelPath : "");
+  return do_get_file(relpath, false);
+}
+
+/**
  * Helper function for getting the updated directory.
  */
 function getUpdatedDirPath() {
   let suffix = "";
   if (gBackgroundUpdate) {
     suffix = UPDATED_DIR_SUFFIX;
   }
   return getApplyDirPath() + suffix;
@@ -501,17 +561,17 @@ function copyMinimumAppFiles(aSrcDir, aD
       logTestInfo("unable to create directory, path: " + destDir.path +
                   ", exception: " + e);
       do_throw(e);
     }
   }
 
   // Required files for the application or the test that aren't listed in the
   // dependentlibs.list file.
-  let fileLeafNames = [APP_BIN_NAME + APP_BIN_SUFFIX, UPDATER_BIN_FILE,
+  let fileLeafNames = [APP_BIN_NAME + APP_BIN_SUFFIX, FILE_UPDATER_BIN,
                        FILE_UPDATE_SETTINGS_INI, "application.ini",
                        "dependentlibs.list"];
 
   // Read the dependent libs file leafnames from the dependentlibs.list file
   // into the array.
   let deplibsFile = aSrcDir.clone();
   deplibsFile.append("dependentlibs.list");
   let istream = AUS_Cc["@mozilla.org/network/file-input-stream;1"].
@@ -550,23 +610,23 @@ function copyMinimumAppFiles(aSrcDir, aD
  */
 function runUpdate() {
   // Copy the updater binary to the updates directory.
   let binDir = getGREDir();
   let updater = binDir.clone();
   updater.append("updater.app");
   if (!updater.exists()) {
     updater = binDir.clone();
-    updater.append(UPDATER_BIN_FILE);
+    updater.append(FILE_UPDATER_BIN);
     if (!updater.exists()) {
       do_throw("Unable to find updater binary!");
     }
   }
 
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX, true);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX, true);
   updater.copyTo(updatesDir, updater.leafName);
   let updateBin = updatesDir.clone();
   updateBin.append(updater.leafName);
   if (updateBin.leafName == "updater.app") {
     updateBin.append("Contents");
     updateBin.append("MacOS");
     updateBin.append("updater");
     if (!updateBin.exists())
@@ -674,28 +734,28 @@ function shouldRunServiceTest(aFirstTest
   catch (e) {
     logTestInfo("this test can only run on the buildbot build system at this " +
                 "time.");
     return false;
   }
 
   let binDir = getGREDir();
   let updaterBin = binDir.clone();
-  updaterBin.append(UPDATER_BIN_FILE);
+  updaterBin.append(FILE_UPDATER_BIN);
   if (!updaterBin.exists()) {
     do_throw("Unable to find updater binary!");
   }
 
   let updaterBinPath = updaterBin.path;
   if (/ /.test(updaterBinPath)) {
     updaterBinPath = '"' + updaterBinPath + '"';
   }
 
   // Check to make sure the service is installed
-  let helperBin = do_get_file(HELPER_BIN_FILE);
+  let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let args = ["wait-for-service-stop", "MozillaMaintenance", "10"];
   let process = AUS_Cc["@mozilla.org/process/util;1"].
                 createInstance(AUS_Ci.nsIProcess);
   process.init(helperBin);
   logTestInfo("Checking if the service exists on this machine.");
   process.run(true, args, args.length);
   if (process.exitValue == 0xEE) {
     logTestInfo("this test can only run when the service is installed.");
@@ -721,17 +781,17 @@ function shouldRunServiceTest(aFirstTest
   process = AUS_Cc["@mozilla.org/process/util;1"].
             createInstance(AUS_Ci.nsIProcess);
   process.init(helperBin);
   process.run(true, args, args.length);
   if (process.exitValue == 0) {
     return true;
   }
   logTestInfo("this test can only run on builds with signed binaries. " +
-              HELPER_BIN_FILE + " returned " + process.exitValue)
+              FILE_HELPER_BIN + " returned " + process.exitValue)
   return false;
 #endif
 }
 
 /**
  * Copies the specified filename from the dist/bin
  * directory into the apply-to directory.
  *
@@ -763,19 +823,19 @@ function attemptServiceInstall() {
                 .getProperty("version");
   var isVistaOrHigher = (parseFloat(version) >= 6.0);
   if (isVistaOrHigher) {
     return;
   }
 
   let binDir = getGREDir();
   let installerFile = binDir.clone();
-  installerFile.append(MAINTENANCE_SERVICE_INSTALLER_BIN_FILE);
+  installerFile.append(FILE_MAINTENANCE_SERVICE_INSTALLER_BIN);
   if (!installerFile.exists()) {
-    do_throw(MAINTENANCE_SERVICE_INSTALLER_BIN_FILE + " not found.");
+    do_throw(FILE_MAINTENANCE_SERVICE_INSTALLER_BIN + " not found.");
   }
   let installerProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   installerProcess.init(installerFile);
   logTestInfo("Starting installer process...");
   installerProcess.run(true, [], 0);
 }
 
@@ -815,17 +875,17 @@ function runUpdateUsingService(aInitialS
     // In case the SCM thinks the service is stopped, but process still exists.
     waitForApplicationStop("maintenanceservice.exe");
   }
   function waitForServiceStop(aFailTest) {
     waitServiceApps();
     logTestInfo("Waiting for service to stop if necessary...");
     // Use the helper bin to ensure the service is stopped. If not
     // stopped then wait for the service to be stopped (at most 120 seconds)
-    let helperBin = do_get_file(HELPER_BIN_FILE);
+    let helperBin = getTestDirFile(FILE_HELPER_BIN);
     let helperBinArgs = ["wait-for-service-stop",
                          "MozillaMaintenance",
                          "120"];
     let helperBinProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
     helperBinProcess.init(helperBin);
     logTestInfo("Stopping service...");
     helperBinProcess.run(true, helperBinArgs, helperBinArgs.length);
@@ -845,17 +905,17 @@ function runUpdateUsingService(aInitialS
     }
     waitServiceApps();
   }
   function waitForApplicationStop(application) {
     logTestInfo("Waiting for " + application + " to stop if " +
                 "necessary...");
     // Use the helper bin to ensure the application is stopped.
     // If not, then wait for it to be stopped (at most 120 seconds)
-    let helperBin = do_get_file(HELPER_BIN_FILE);
+    let helperBin = getTestDirFile(FILE_HELPER_BIN);
     let helperBinArgs = ["wait-for-application-exit",
                          application,
                          "120"];
     let helperBinProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
     helperBinProcess.init(helperBin);
     helperBinProcess.run(true, helperBinArgs, helperBinArgs.length);
     if (helperBinProcess.exitValue != 0) {
@@ -899,17 +959,17 @@ function runUpdateUsingService(aInitialS
   let svcOriginalLog;
   if (aCheckSvcLog) {
     svcOriginalLog = readServiceLogFile();
   }
 
   let appArgsLogPath = getAppArgsLogPath();
   gServiceLaunchedCallbackLog = appArgsLogPath.replace(/^"|"$/g, "");
 
-  let updatesDir = aUpdatesDir || do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = aUpdatesDir || do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   let file = updatesDir.clone();
   file.append(FILE_UPDATE_STATUS);
   writeFile(file, aInitialStatus + "\n");
 
   // sanity check
   do_check_eq(readStatusFile(updatesDir), aInitialStatus);
 
   file = updatesDir.clone();
@@ -941,24 +1001,24 @@ function runUpdateUsingService(aInitialS
     gShouldResetEnv = undefined;
   }
 
   setEnvironment();
 
   // There is a security check done by the service to make sure the updater
   // we are executing is the same as the one in the apply-to dir.
   // To make sure they match from tests we copy updater.exe to the apply-to dir.
-  copyBinToApplyToDir(UPDATER_BIN_FILE);
+  copyBinToApplyToDir(FILE_UPDATER_BIN);
 
   // The service will execute maintenanceservice_installer.exe and
   // will copy maintenanceservice.exe out of the same directory from
   // the installation directory.  So we need to make sure both of those
   // bins always exist in the installation directory.
-  copyBinToApplyToDir(MAINTENANCE_SERVICE_BIN_FILE);
-  copyBinToApplyToDir(MAINTENANCE_SERVICE_INSTALLER_BIN_FILE);
+  copyBinToApplyToDir(FILE_MAINTENANCE_SERVICE_BIN);
+  copyBinToApplyToDir(FILE_MAINTENANCE_SERVICE_INSTALLER_BIN);
 
   // Backup the updater-settings.ini file if it exists by moving it.
   let updateSettingsIni = getApplyDirFile(null, true);
   updateSettingsIni.append(FILE_UPDATE_SETTINGS_INI);
   if (updateSettingsIni.exists()) {
     updateSettingsIni.moveTo(updateSettingsIni.parent, FILE_UPDATE_SETTINGS_INI_BAK);
   }
   updateSettingsIni = getApplyDirFile(null, true);
@@ -1097,17 +1157,17 @@ function setupHelperFinish() {
  * Helper function for updater binary tests for setting up the files and
  * directories used by the test.
  *
  * @param   aMarFile
  *          The mar file for the update test.
  */
 function setupUpdaterTest(aMarFile) {
   // Remove the directory where the updater, mar file, etc. will be copied to
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX, true);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX, true);
   try {
     removeDirRecursive(updatesDir);
   }
   catch (e) {
     dump("Unable to remove directory\n" +
          "path: " + updatesDir.path + "\n" +
          "Exception: " + e + "\n");
   }
@@ -1134,17 +1194,17 @@ function setupUpdaterTest(aMarFile) {
   TEST_FILES.forEach(function SUT_TF_FE(aTestFile) {
     if (aTestFile.originalFile || aTestFile.originalContents) {
       let testDir = getApplyDirFile(aTestFile.relPathDir, true);
       if (!testDir.exists())
         testDir.create(AUS_Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
 
       let testFile;
       if (aTestFile.originalFile) {
-        testFile = do_get_file(aTestFile.originalFile);
+        testFile = getTestDirFile(aTestFile.originalFile);
         testFile.copyTo(testDir, aTestFile.fileName);
         testFile = getApplyDirFile(aTestFile.relPathDir + aTestFile.fileName);
       }
       else {
         testFile = getApplyDirFile(aTestFile.relPathDir + aTestFile.fileName, true);
         writeFile(testFile, aTestFile.originalContents);
       }
 
@@ -1155,68 +1215,69 @@ function setupUpdaterTest(aMarFile) {
         // Store the actual permissions on the file for reference later after
         // setting the permissions.
         if (!aTestFile.comparePerms)
           aTestFile.comparePerms = testFile.permissions;
       }
     }
   });
 
-  let helperBin = do_get_file(HELPER_BIN_FILE);
+  let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let afterApplyBinDir = getApplyDirFile("a/b/", true);
   helperBin.copyTo(afterApplyBinDir, gCallbackBinFile);
 
   // Copy the mar that will be applied
-  let mar = do_get_file(aMarFile);
+  let mar = getTestDirFile(aMarFile);
   mar.copyTo(updatesDir, FILE_UPDATE_ARCHIVE);
 
   // Add the test directory that will be updated for a successful update or left in
   // the initial state for a failed update.
   var testDirs = TEST_DIRS.concat(ADDITIONAL_TEST_DIRS);
   testDirs.forEach(function SUT_TD_FE(aTestDir) {
     let testDir = getApplyDirFile(aTestDir.relPathDir, true);
     if (!testDir.exists()) {
       testDir.create(AUS_Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
     }
 
     if (aTestDir.files) {
       aTestDir.files.forEach(function SUT_TD_F_FE(aTestFile) {
         let testFile = getApplyDirFile(aTestDir.relPathDir + aTestFile, true);
         if (!testFile.exists()) {
-          testFile.create(AUS_Ci.nsIFile.FILE_TYPE, PERMS_FILE);
+          testFile.create(AUS_Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
         }
       });
     }
 
     if (aTestDir.subDirs) {
       aTestDir.subDirs.forEach(function SUT_TD_SD_FE(aSubDir) {
         let testSubDir = getApplyDirFile(aTestDir.relPathDir + aSubDir, true);
         if (!testSubDir.exists()) {
           testSubDir.create(AUS_Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
         }
 
         if (aTestDir.subDirFiles) {
           aTestDir.subDirFiles.forEach(function SUT_TD_SDF_FE(aTestFile) {
             let testFile = getApplyDirFile(aTestDir.relPathDir + aSubDir + aTestFile, true);
             if (!testFile.exists()) {
-              testFile.create(AUS_Ci.nsIFile.FILE_TYPE, PERMS_FILE);
+              testFile.create(AUS_Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
             }
           });
         }
       });
     }
   });
 }
 
 /**
  * Helper function for updater binary tests to clean up the state after the test
  * has finished.
  */
 function cleanupUpdaterTest() {
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX, true);
+  logTestInfo("start - updater test cleanup");
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX, true);
   try {
     removeDirRecursive(updatesDir);
   }
   catch (e) {
     dump("Unable to remove directory\n" +
          "path: " + updatesDir.path + "\n" +
          "Exception: " + e + "\n");
   }
@@ -1227,25 +1288,26 @@ function cleanupUpdaterTest() {
     removeDirRecursive(applyToDir);
   }
   catch (e) {
     dump("Unable to remove directory\n" +
          "path: " + applyToDir.path + "\n" +
          "Exception: " + e + "\n");
   }
 
-  cleanUp();
+  cleanupTestCommon();
+  logTestInfo("finish - updater test cleanup");
 }
 
 /**
  * Helper function for updater binary tests for verifying the contents of the
  * update log after a successful update.
  */
 function checkUpdateLogContents(aCompareLogFile) {
-  let updateLog = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX, true);
+  let updateLog = do_get_file(gTestID + UPDATES_DIR_SUFFIX, true);
   updateLog.append(FILE_UPDATE_LOG);
   let updateLogContents = readFileBytes(updateLog);
   if (gBackgroundUpdate) {
     // Skip the background update messages
     updateLogContents = updateLogContents.replace(/Performing a background update/, "");
   } else if (gSwitchApp) {
     // Skip the switch app request messages
     updateLogContents = updateLogContents.replace(/Performing a background update/, "");
@@ -1275,30 +1337,46 @@ function checkUpdateLogContents(aCompare
   // The FindFile results when enumerating the filesystem on Windows is not
   // determistic so the results matching the following need to be ignored.
   updateLogContents = updateLogContents.replace(/.* a\/b\/7\/7text.*\n/g, "");
   // Remove consecutive newlines
   updateLogContents = updateLogContents.replace(/\n+/g, "\n");
   // Remove leading and trailing newlines
   updateLogContents = updateLogContents.replace(/^\n|\n$/g, "");
 
-  let compareLog = do_get_file(aCompareLogFile);
+  let compareLog = getTestDirFile(aCompareLogFile);
   let compareLogContents = readFileBytes(compareLog);
   // Remove leading and trailing newlines
   compareLogContents = compareLogContents.replace(/^\n|\n$/g, "");
 
-  do_check_eq(compareLogContents, updateLogContents);
+  // Don't write the contents of the file to the log to reduce log spam
+  // unless there is a failure.
+  if (compareLogContents == updateLogContents) {
+    logTestInfo("log contents are correct");
+    do_check_true(true);
+  }
+  else {
+    logTestInfo("log contents are not correct");
+    do_check_eq(compareLogContents, updateLogContents);
+  }
 }
 
 function checkUpdateLogContains(aCheckString) {
-  let updateLog = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX, true);
+  let updateLog = do_get_file(gTestID + UPDATES_DIR_SUFFIX, true);
   updateLog.append(FILE_UPDATE_LOG);
   let updateLogContents = readFileBytes(updateLog);
-  logTestInfo("log file contents:\n" + updateLogContents + "\n");
-  do_check_true(updateLogContents.indexOf(aCheckString) != -1);
+  if (updateLogContents.indexOf(aCheckString) != -1) {
+    logTestInfo("log file does contain: " + aCheckString);
+    do_check_true(true);
+  }
+  else {
+    logTestInfo("log file does not contain: " + aCheckString);
+    logTestInfo("log file contents:\n" + updateLogContents);
+    do_check_true(false);
+  }
 }
 
 /**
  * Helper function for updater binary tests for verifying the state of files and
  * directories after a successful update.
  */
 function checkFilesAfterUpdateSuccess() {
   logTestInfo("testing contents of files after a successful update");
@@ -1317,22 +1395,29 @@ function checkFilesAfterUpdateSuccess() 
           logPerms += "original permissions: " + aTestFile.originalPerms.toString(8) + ", ";
         }
         logPerms += "compare permissions : " + aTestFile.comparePerms.toString(8) + ", ";
         logPerms += "updated permissions : " + testFile.permissions.toString(8);
         logTestInfo(logPerms);
         do_check_eq(testFile.permissions & 0xfff, aTestFile.comparePerms & 0xfff);
       }
 
-      if (aTestFile.compareFile) {
-        do_check_eq(readFileBytes(testFile),
-                    readFileBytes(do_get_file(aTestFile.compareFile)));
+      let fileContents1 = readFileBytes(testFile);
+      let fileContents2 = aTestFile.compareFile ?
+                          readFileBytes(getTestDirFile(aTestFile.compareFile)) :
+                          aTestFile.compareContents;
+      // Don't write the contents of the file to the log to reduce log spam
+      // unless there is a failure.
+      if (fileContents1 == fileContents2) {
+        logTestInfo("file contents are correct");
+        do_check_true(true);
       }
       else {
-        do_check_eq(readFileBytes(testFile), aTestFile.compareContents);
+        logTestInfo("file contents are not correct");
+        do_check_eq(fileContents1, fileContents2);
       }
     }
     else {
       do_check_false(testFile.exists());
     }
   });
 
   logTestInfo("testing operations specified in removed-files were performed " +
@@ -1405,22 +1490,29 @@ function checkFilesAfterUpdateFailure(aG
           logPerms += "original permissions: " + aTestFile.originalPerms.toString(8) + ", ";
         }
         logPerms += "compare permissions : " + aTestFile.comparePerms.toString(8) + ", ";
         logPerms += "updated permissions : " + testFile.permissions.toString(8);
         logTestInfo(logPerms);
         do_check_eq(testFile.permissions & 0xfff, aTestFile.comparePerms & 0xfff);
       }
 
-      if (aTestFile.compareFile) {
-        do_check_eq(readFileBytes(testFile),
-                    readFileBytes(do_get_file(aTestFile.compareFile)));
+      let fileContents1 = readFileBytes(testFile);
+      let fileContents2 = aTestFile.compareFile ?
+                          readFileBytes(getTestDirFile(aTestFile.compareFile)) :
+                          aTestFile.compareContents;
+      // Don't write the contents of the file to the log to reduce log spam
+      // unless there is a failure.
+      if (fileContents1 == fileContents2) {
+        logTestInfo("file contents are correct");
+        do_check_true(true);
       }
       else {
-        do_check_eq(readFileBytes(testFile), aTestFile.compareContents);
+        logTestInfo("file contents are not correct");
+        do_check_eq(fileContents1, fileContents2);
       }
     }
     else {
       do_check_false(testFile.exists());
     }
   });
 
   logTestInfo("testing operations specified in removed-files were not " +
@@ -1458,17 +1550,17 @@ function checkFilesAfterUpdateFailure(aG
 }
 
 /**
  * Helper function for updater binary tests for verifying patch files and
  * moz-backup files aren't left behind after a successful or failed update.
  */
 function checkFilesAfterUpdateCommon() {
   logTestInfo("testing patch files should not be left behind");
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX, true);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX, true);
   let entries = updatesDir.QueryInterface(AUS_Ci.nsIFile).directoryEntries;
   while (entries.hasMoreElements()) {
     let entry = entries.getNext().QueryInterface(AUS_Ci.nsIFile);
     do_check_neq(getFileExtension(entry), "patch");
   }
 
   logTestInfo("testing backup files should not be left behind");
   let applyToDir = getTargetDirFile(null, true);
@@ -1493,19 +1585,24 @@ function checkCallbackAppLog() {
   // contents are completely written so wait until the contents are the expected
   // value. If the contents are never the expected value then the test will
   // fail by timing out.
   if (logContents != expectedLogContents) {
     do_timeout(TEST_HELPER_TIMEOUT, checkCallbackAppLog);
     return;
   }
 
-  logTestInfo("testing that the callback application successfully launched " +
-              "and the expected command line arguments passed to it");
-  do_check_eq(logContents, expectedLogContents);
+  if (logContents == expectedLogContents) {
+    logTestInfo("callback log file contents are correct");
+    do_check_true(true);
+  }
+  else {
+    logTestInfo("callback log file contents are not correct");
+    do_check_eq(logContents, expectedLogContents);
+  }
 
   removeCallbackCopy();
 }
 
 /**
  * Helper function for updater service tests for verifying the contents of the
  * updater callback application log which should contain the arguments passed to
  * the callback application.
@@ -1534,17 +1631,17 @@ function checkCallbackServiceLog() {
 
   removeCallbackCopy();
 }
 
 function removeCallbackCopy() {
   // Remove the copy of the application executable used for the test on
   // Windows if it exists.
   let appBinCopy = getAppDir();
-  appBinCopy.append(TEST_ID + FILE_WIN_TEST_EXE);
+  appBinCopy.append(gTestID + FILE_WIN_TEST_EXE);
   if (appBinCopy.exists()) {
     try {
       logTestInfo("attempting removal of file: " + appBinCopy.path);
       appBinCopy.remove(false);
     }
     catch (e) {
       logTestInfo("non-fatal error removing file after test finished (will " +
                   "try again). File: " + appBinCopy.path + " Exception: " + e);
@@ -1562,17 +1659,17 @@ function removeCallbackCopy() {
  * ending the test so the updater binary isn't in use during test cleanup.
  */
 function removeUpdater() {
   if (IS_WIN) {
     // Remove the copy of the application executable used for the test on
     // Windows if it exists.
     let updater = getUpdatesDir();
     updater.append("0");
-    updater.append(UPDATER_BIN_FILE);
+    updater.append(FILE_UPDATER_BIN);
     if (updater.exists()) {
       try {
         updater.remove(false);
       }
       catch (e) {
         logTestInfo("non-fatal error removing file after test finished (will " +
                     "try again). File: " + updater.path + " Exception: " + e);
         do_timeout(TEST_HELPER_TIMEOUT, removeUpdater);
@@ -1586,17 +1683,17 @@ function removeUpdater() {
   logTestInfo("calling do_test_finished");
   do_test_finished();
 }
 
 // Waits until files that are in use that break tests are no longer in use and
 // then calls removeCallbackCopy.
 function waitForFilesInUse() {
   let maintSvcInstaller = getAppDir();
-  maintSvcInstaller.append("MAINTENANCE_SERVICE_INSTALLER_BIN_FILE");
+  maintSvcInstaller.append("FILE_MAINTENANCE_SERVICE_INSTALLER_BIN");
 
   let helper = getAppDir();
   helper.append("uninstall");
   helper.append("helper.exe");
 
   let files = [maintSvcInstaller, helper];
   for (let i = 0; i < files.length; ++i) {
     let file = files[i];
@@ -1851,37 +1948,33 @@ const updateCheckListener = {
         !aIID.equals(AUS_Ci.nsISupports))
       throw AUS_Cr.NS_ERROR_NO_INTERFACE;
     return this;
   }
 };
 
 /**
  * Helper for starting the http server used by the tests
- *
- * @param   aRelativeDirName
- *          The directory name to register relative to
- *          toolkit/mozapps/update/test/unit/
  */
-function start_httpserver(aRelativeDirName) {
-  var dir = do_get_file(aRelativeDirName);
-  if (!dir.exists())
-    do_throw("The directory used by HttpServer does not exist! path: " +
-             dir.path + "\n");
+function start_httpserver() {
+  let dir = getTestDirFile();
+  logTestInfo("http server file path: " + dir.path);
 
-  if (!dir.isDirectory())
+  if (!dir.isDirectory()) {
     do_throw("A file instead of a directory was specified for HttpServer " +
              "registerDirectory! path: " + dir.path + "\n");
+  }
 
   Components.utils.import("resource://testing-common/httpd.js");
   gTestserver = new HttpServer();
-  gTestserver.registerDirectory("/data/", dir);
+  gTestserver.registerDirectory("/", dir);
   gTestserver.start(-1);
-  gTestserverPort = gTestserver.identity.primaryPort;
-  logTestInfo("http server port = " + gTestserverPort);
+  let testserverPort = gTestserver.identity.primaryPort;
+  gURLData = URL_HOST + ":" + testserverPort + "/";
+  logTestInfo("http server port = " + testserverPort);
 }
 
 /* Helper for stopping the http server used by the tests */
 function stop_httpserver(callback) {
   do_check_true(!!callback);
   gTestserver.stop(callback);
 }
 
@@ -1996,17 +2089,17 @@ function getProcessArgs(aExtraArgs) {
 /**
  * Gets a file path for piping the console output from the application so it
  * doesn't appear in the xpcshell log file.
  *
  * @return  path to the file for piping the console output from the application.
  */
 function getAppConsoleLogPath() {
   let appConsoleLog = do_get_file("/", true);
-  appConsoleLog.append(TEST_ID + "_app_console_log");
+  appConsoleLog.append(gTestID + "_app_console_log");
   if (appConsoleLog.exists()) {
     appConsoleLog.remove(false);
   }
   let appConsoleLogPath = appConsoleLog.path;
   if (/ /.test(appConsoleLogPath)) {
     appConsoleLogPath = '"' + appConsoleLogPath + '"';
   }
   return appConsoleLogPath;
@@ -2015,17 +2108,17 @@ function getAppConsoleLogPath() {
 /**
  * Gets a file path for the application to dump its arguments into.  This is used
  * to verify that a callback application is launched.
  *
  * @return  the file for the application to dump its arguments into.
  */
 function getAppArgsLogPath() {
   let appArgsLog = do_get_file("/", true);
-  appArgsLog.append("app_args_log");
+  appArgsLog.append(gTestID + "_app_args_log");
   if (appArgsLog.exists()) {
     appArgsLog.remove(false);
   }
   let appArgsLogPath = appArgsLog.path;
   if (/ /.test(appArgsLogPath)) {
     appArgsLogPath = '"' + appArgsLogPath + '"';
   }
   return appArgsLogPath;
@@ -2034,17 +2127,17 @@ function getAppArgsLogPath() {
 /**
  * Gets the nsIFile reference for the shell script to launch the application. If
  * the file exists it will be removed by this function.
  *
  * @return  the nsIFile for the shell script to launch the application.
  */
 function getLaunchScript() {
   let launchScript = do_get_file("/", true);
-  launchScript.append("launch.sh");
+  launchScript.append(gTestID + "_launch.sh");
   if (launchScript.exists()) {
     launchScript.remove(false);
   }
   return launchScript;
 }
 
 /**
  * Checks for the existence of a platform specific application binary that can
@@ -2056,23 +2149,23 @@ function getLaunchScript() {
  */
 XPCOMUtils.defineLazyGetter(this, "gAppBinPath", function test_gAppBinPath() {
   let processDir = getAppDir();
   let appBin = processDir.clone();
   appBin.append(APP_BIN_NAME + APP_BIN_SUFFIX);
   if (appBin.exists()) {
     if (IS_WIN) {
       let appBinCopy = processDir.clone();
-      appBinCopy.append(TEST_ID + FILE_WIN_TEST_EXE);
+      appBinCopy.append(gTestID + FILE_WIN_TEST_EXE);
       if (appBinCopy.exists()) {
         appBinCopy.remove(false);
       }
-      appBin.copyTo(processDir, TEST_ID + FILE_WIN_TEST_EXE);
+      appBin.copyTo(processDir, gTestID + FILE_WIN_TEST_EXE);
       appBin = processDir.clone();
-      appBin.append(TEST_ID + FILE_WIN_TEST_EXE);
+      appBin.append(gTestID + FILE_WIN_TEST_EXE);
     }
     let appBinPath = appBin.path;
     if (/ /.test(appBinPath)) {
       appBinPath = '"' + appBinPath + '"';
     }
     return appBinPath;
   }
   return null;
rename from toolkit/mozapps/update/test/unit/test_0020_general.js
rename to toolkit/mozapps/update/tests/unit_aus_update/remoteUpdateXML.js
--- a/toolkit/mozapps/update/test/unit/test_0020_general.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/remoteUpdateXML.js
@@ -1,37 +1,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General Update Check Update XML Tests */
-
-const TEST_ID = "0020";
-
 var gNextRunFunc;
 var gExpectedCount;
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  logTestInfo("testing remote update xml attributes");
 
-  removeUpdateDirsAndFiles();
   setUpdateURLOverride();
   setUpdateChannel("test_channel");
   // The mock XMLHttpRequest is MUCH faster
   overrideXHR(callHandleEvent);
   standardInit();
   do_execute_soon(run_test_pt01);
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
 
 // Helper function for testing update counts returned from an update xml
 function run_test_helper_pt1(aMsg, aExpectedCount, aNextRunFunc) {
   gUpdates = null;
   gUpdateCount = null;
   gCheckFunc = check_test_helper_pt1;
   gNextRunFunc = aNextRunFunc;
rename from toolkit/mozapps/update/test/unit/test_0081_prompt_uiAlreadyOpen.js
rename to toolkit/mozapps/update/tests/unit_aus_update/uiOnlyAllowOneWindow.js
--- a/toolkit/mozapps/update/test/unit/test_0081_prompt_uiAlreadyOpen.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/uiOnlyAllowOneWindow.js
@@ -2,29 +2,22 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /**
  * Test that nsIUpdatePrompt doesn't display UI for showUpdateInstalled and
  * showUpdateAvailable when there is already an application update window open.
  */
 
-const TEST_ID = "0081";
-
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   logTestInfo("testing nsIUpdatePrompt notifications should not be seen when " +
               "there is already an application update window open");
 
-  removeUpdateDirsAndFiles();
-
   Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
 
   let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
   registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                             "Fake Window Watcher",
                             "@mozilla.org/embedcomp/window-watcher;1",
                             WindowWatcherFactory);
   registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af56}"),
@@ -64,17 +57,17 @@ function run_test() {
                               WindowWatcherFactory);
   registrar.unregisterFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af56}"),
                               WindowMediatorFactory);
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
 
 function check_showUpdateInstalled() {
   do_throw("showUpdateInstalled should not have called openWindow!");
 }
 
 function check_showUpdateAvailable() {
   do_throw("showUpdateAvailable should not have called openWindow!");
rename from toolkit/mozapps/update/test/unit/test_0080_prompt_silent.js
rename to toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js
--- a/toolkit/mozapps/update/test/unit/test_0080_prompt_silent.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js
@@ -3,29 +3,22 @@
  */
 
 /**
  * Test that nsIUpdatePrompt doesn't display UI for showUpdateInstalled,
  * showUpdateAvailable, and showUpdateError when the app.update.silent
  * preference is true.
  */
 
-const TEST_ID = "0080";
-
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   logTestInfo("testing nsIUpdatePrompt notifications should not be seen " +
               "when the " + PREF_APP_UPDATE_SILENT + " preference is true");
 
-  removeUpdateDirsAndFiles();
-
   Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, true);
 
   let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
   registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                             "Fake Window Watcher",
                             "@mozilla.org/embedcomp/window-watcher;1",
                             WindowWatcherFactory);
 
@@ -67,17 +60,17 @@ function run_test() {
   let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
   registrar.unregisterFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                               WindowWatcherFactory);
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
 
 function check_showUpdateInstalled() {
   do_throw("showUpdateInstalled should not have called openWindow!");
 }
 
 function check_showUpdateAvailable() {
   do_throw("showUpdateAvailable should not have called openWindow!");
rename from toolkit/mozapps/update/test/unit/test_0082_prompt_unsupportAlreadyNotified.js
rename to toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
--- a/toolkit/mozapps/update/test/unit/test_0082_prompt_unsupportAlreadyNotified.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
@@ -1,46 +1,37 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/**
- * Test that nsIUpdatePrompt doesn't display UI for showUpdateAvailable for an
- * unsupported system update when it has already been shown (bug 843497).
- */
-
-const TEST_ID = "0082";
+function run_test() {
+  setupTestCommon(true);
 
-function run_test() {
-  do_test_pending();
+  logTestInfo("testing nsIUpdatePrompt notifications should not be displayed " +
+              "when showUpdateAvailable is called for an unsupported system " +
+              "update when the unsupported notification has already been " +
+              "shown (bug 843497)");
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  removeUpdateDirsAndFiles();
   setUpdateURLOverride();
   // The mock XMLHttpRequest is MUCH faster
   overrideXHR(callHandleEvent);
   standardInit();
   // The HTTP server is only used for the mar file downloads which is slow
-  start_httpserver(URL_PATH);
+  start_httpserver();
 
   let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
   registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                             "Fake Window Watcher",
                             "@mozilla.org/embedcomp/window-watcher;1",
                             WindowWatcherFactory);
   registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af56}"),
                             "Fake Window Mediator",
                             "@mozilla.org/appshell/window-mediator;1",
                             WindowMediatorFactory);
 
-  logTestInfo("testing nsIUpdatePrompt notifications should not be seen for " +
-              "an unsupported system update when it has already been shown");
-
   Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
   Services.prefs.setBoolPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED, true);
   // This preference is used to determine when the background update check has
   // completed since a successful check will clear the preference.
   Services.prefs.setIntPref(PREF_APP_UPDATE_BACKGROUNDERRORS, 1);
 
   gResponseBody = getRemoteUpdatesXMLString("  <update type=\"major\" " +
                                             "name=\"Unsupported Update\" " +
@@ -61,17 +52,17 @@ function check_test() {
 }
 
 function end_test() {
   let registrar = Components.manager.QueryInterface(AUS_Ci.nsIComponentRegistrar);
   registrar.unregisterFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                               WindowWatcherFactory);
   registrar.unregisterFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af56}"),
                               WindowMediatorFactory);
-  cleanUp();
+  cleanupTestCommon();
 }
 
 // Callback function used by the custom XMLHttpRequest implementation to
 // call the nsIDOMEventListener's handleEvent method for onload.
 function callHandleEvent() {
   gXHR.status = 400;
   gXHR.responseText = gResponseBody;
   try {
rename from toolkit/mozapps/update/test/unit/test_0050_general.js
rename to toolkit/mozapps/update/tests/unit_aus_update/updateCheckOnLoadOnErrorStatusText.js
--- a/toolkit/mozapps/update/test/unit/test_0050_general.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/updateCheckOnLoadOnErrorStatusText.js
@@ -1,43 +1,37 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General nsIUpdateCheckListener onload and onerror error code and statusText
-   Tests */
-
 // Errors tested:
 // 200, 403, 404, 500, 2152398849, 2152398862, 2152398864, 2152398867,
 // 2152398868, 2152398878, 2152398890, 2152398919, 2152398920, 2153390069,
 // 2152398918, 2152398861
 
-const TEST_ID = "0050";
-
 var gNextRunFunc;
 var gExpectedStatusCode;
 var gExpectedStatusText;
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  logTestInfo("testing nsIUpdateCheckListener onload and onerror error code " +
+              "and statusText values");
 
-  removeUpdateDirsAndFiles();
   setUpdateURLOverride();
   standardInit();
   // The mock XMLHttpRequest is MUCH faster
   overrideXHR(callHandleEvent);
   do_execute_soon(run_test_pt1);
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
 
 // Callback function used by the custom XMLHttpRequest implementation to
 // call the nsIDOMEventListener's handleEvent method for onload.
 function callHandleEvent() {
   gXHR.status = gExpectedStatusCode;
   var e = { target: gXHR };
   gXHR.onload(e);
rename from toolkit/mozapps/update/test/unit/test_0060_manager.js
rename to toolkit/mozapps/update/tests/unit_aus_update/updateManagerXML.js
--- a/toolkit/mozapps/update/test/unit/test_0060_manager.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/updateManagerXML.js
@@ -1,27 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-/* General Update Manager Tests */
-
-const TEST_ID = "0060";
-
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   logTestInfo("testing addition of a successful update to " + FILE_UPDATES_DB +
-              " and verification of update properties with the format prior " +
-              "to bug 530872");
-  removeUpdateDirsAndFiles();
+              " and verification of update properties including the format " +
+              "prior to bug 530872");
+
   setUpdateChannel("test_channel");
 
   var patch, patches, update, updates;
   // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244
   // and until bug 470244 is fixed this will not test the value for detailsURL 
   // when it isn't specified in the update xml.
   patches = getLocalPatchString("partial", "http://partial/", "SHA256", "cd43",
                                 "86", "true", STATE_PENDING);
@@ -173,17 +166,17 @@ function run_test() {
   do_check_eq(update.channel, "test_channel");
   do_check_true(update.showPrompt);
   do_check_true(update.showNeverForVersion);
   do_check_eq(update.promptWaitTime, "100");
   do_check_eq(update.previousAppVersion, "3.0");
 
   patch = update.selectedPatch;
   do_check_eq(patch.type, "complete");
-  do_check_eq(patch.URL, URL_HOST + "/" + URL_PATH + "/" + FILE_SIMPLE_MAR);
+  do_check_eq(patch.URL, URL_HOST + "/" + FILE_SIMPLE_MAR);
   do_check_eq(patch.hashFunction, "MD5");
   do_check_eq(patch.hashValue, MD5_HASH_SIMPLE_MAR);
   do_check_eq(patch.size, SIZE_SIMPLE_MAR);
   do_check_true(patch.selected);
   do_check_eq(patch.state, STATE_SUCCEEDED);
 
   update = gUpdateManager.getUpdateAt(1);
   do_check_eq(update.state, STATE_FAILED);
@@ -203,21 +196,21 @@ function run_test() {
   do_check_eq(update.channel, "test_channel");
   do_check_false(update.showPrompt);
   do_check_false(update.showNeverForVersion);
   do_check_eq(update.promptWaitTime, "200");
   do_check_eq(update.previousAppVersion, null);
 
   patch = update.selectedPatch;
   do_check_eq(patch.type, "complete");
-  do_check_eq(patch.URL, URL_HOST + "/" + URL_PATH + "/" + FILE_SIMPLE_MAR);
+  do_check_eq(patch.URL, URL_HOST + "/" + FILE_SIMPLE_MAR);
   do_check_eq(patch.hashFunction, "MD5");
   do_check_eq(patch.hashValue, MD5_HASH_SIMPLE_MAR);
   do_check_eq(patch.size, SIZE_SIMPLE_MAR);
   do_check_true(patch.selected);
   do_check_eq(patch.state, STATE_FAILED);
 
   do_test_finished();
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0300_update_root_dir_migration.js
rename to toolkit/mozapps/update/tests/unit_aus_update/updateRootDirMigration_win.js
--- a/toolkit/mozapps/update/test/unit/test_0300_update_root_dir_migration.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/updateRootDirMigration_win.js
@@ -1,20 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-const TEST_ID = "0300";
 const PREF_APP_UPDATE_MIGRATE_APP_DIR = "app.update.migrated.updateDir";
 
-// Maximum number of milliseconds the process that is launched can run before
-// the test will try to kill it.
-const APP_TIMER_TIMEOUT = 120000;
-
 function clearTaskbarIDHash(exePath, appInfoName) {
   let registry = AUS_Cc["@mozilla.org/windows-registry-key;1"].
                  createInstance(AUS_Ci.nsIWindowsRegKey);
   try {
     registry.open(AUS_Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
                   "Software\\Mozilla\\" + appInfoName + "\\TaskBarIDs",
                   AUS_Ci.nsIWindowsRegKey.ACCESS_ALL);
     registry.removeValue(exePath);
@@ -45,17 +40,17 @@ function getMigrated() {
   } catch (e) {
   }
   return migrated;
 }
 
 /* General Update Manager Tests */
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(false);
   do_register_cleanup(end_test);
 
   standardInit();
 
   var appinfo = AUS_Cc["@mozilla.org/xre/app-info;1"].
                 getService(AUS_Ci.nsIXULAppInfo).
                 QueryInterface(AUS_Ci.nsIXULRuntime);
 
@@ -167,10 +162,10 @@ function run_test() {
 }
 
 function end_test() {
   var appinfo = AUS_Cc["@mozilla.org/xre/app-info;1"].
                 getService(AUS_Ci.nsIXULAppInfo).
                 QueryInterface(AUS_Ci.nsIXULRuntime);
   var exeFile = FileUtils.getFile(XRE_EXECUTABLE_FILE, []);
   clearTaskbarIDHash(exeFile.parent.path, appinfo.name);
-  cleanUp();
+  cleanupTestCommon();
 }
rename from toolkit/mozapps/update/test/unit/test_0040_general.js
rename to toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js
--- a/toolkit/mozapps/update/test/unit/test_0040_general.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js
@@ -2,40 +2,34 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 /* General URL Construction Tests */
 
 Components.utils.import("resource://gre/modules/ctypes.jsm")
 
-const TEST_ID = "0040";
-
-const URL_PREFIX = URL_HOST + URL_PATH + "/";
+const URL_PREFIX = URL_HOST + "/";
 
 var gAppInfo;
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  removeUpdateDirsAndFiles();
   // The mock XMLHttpRequest is MUCH faster
   overrideXHR(callHandleEvent);
   standardInit();
   gAppInfo = AUS_Cc["@mozilla.org/xre/app-info;1"].
              getService(AUS_Ci.nsIXULAppInfo).
              QueryInterface(AUS_Ci.nsIXULRuntime);
   do_execute_soon(run_test_pt1);
 }
 
 function end_test() {
-  cleanUp();
+  cleanupTestCommon();
 }
 
 // Callback function used by the custom XMLHttpRequest implementation to
 // call the nsIDOMEventListener's handleEvent method for onload.
 function callHandleEvent() {
   var e = { target: gXHR };
   gXHR.onload(e);
 }
rename from toolkit/mozapps/update/test/unit/xpcshell.ini
rename to toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
--- a/toolkit/mozapps/update/test/unit/xpcshell.ini
+++ b/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
@@ -1,40 +1,40 @@
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
 [DEFAULT]
 head = head_update.js
 tail =
 generated-files = head_update.js
-support-files =
-  data/**
-  xpcshell_updater.ini
 
-[test_0010_general.js]
-[test_0020_general.js]
-[test_0030_general.js]
-[test_0040_general.js]
-[test_0050_general.js]
-[test_0060_manager.js]
-[test_0061_manager.js]
-[test_0062_manager.js]
-[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]
+[canCheckForAndCanApplyUpdates.js]
+[urlConstruction.js]
+[updateCheckOnLoadOnErrorStatusText.js]
+[updateManagerXML.js]
+[remoteUpdateXML.js]
+[downloadMar.js]
+[cleanupDownloadingForOlderAppVersion.js]
+[cleanupDownloadingForDifferentChannel.js]
+[cleanupDownloadingForSameVersionAndBuildID.js]
+[cleanupDownloadingIncorrectStatus.js]
+[cleanupPendingVersionFileIncorrectStatus.js]
+[cleanupSuccessLogMove.js]
+[cleanupSuccessLogsFIFO.js]
+[downloadResumeForSameAppVersion.js]
+[downloadCompleteAfterPartialFailure.js]
 skip-if = toolkit == 'gonk'
 reason = custom nsIUpdatePrompt
-[test_0082_prompt_unsupportAlreadyNotified.js]
+[downloadInterruptedByOfflineRetry.js]
+[downloadFileTooBig_gonk.js]
+run-if = toolkit == 'gonk'
+[uiSilentPref.js]
 skip-if = toolkit == 'gonk'
 reason = custom nsIUpdatePrompt
-
-; Tests that require the updater binary. Conditions for the included ini file
-; aren't used due to cascading of the conditions (see bug 676876).
-[include:xpcshell_updater.ini]
-
-[test_bug595059.js]
+[uiOnlyAllowOneWindow.js]
 skip-if = toolkit == 'gonk'
 reason = custom nsIUpdatePrompt
-[test_bug794211.js]
-[test_bug833708.js]
-run-if = toolkit == 'gonk'
+[uiUnsupportedAlreadyNotified.js]
+skip-if = toolkit == 'gonk'
+reason = custom nsIUpdatePrompt
+[updateRootDirMigration_win.js]
+run-if = os == 'win'
rename from toolkit/mozapps/update/test/unit/test_0203_app_launch_apply_update.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
--- a/toolkit/mozapps/update/test/unit/test_0203_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
@@ -13,47 +13,36 @@
  * make the updater fall back to apply the update regularly.
  */
 
 /**
  * The MAR file used for this test should not contain a version 2 update
  * manifest file (e.g. updatev2.manifest).
  */
 
-const TEST_ID = "0203";
-
-// Backup the updater.ini and use a custom one to prevent the updater from
-// launching a post update executable.
-const FILE_UPDATER_INI_BAK = "updater.ini.bak";
-
-// Maximum number of milliseconds the process that is launched can run before
-// the test will try to kill it.
-const APP_TIMER_TIMEOUT = 120000;
 
 Components.utils.import("resource://gre/modules/ctypes.jsm");
 
 let gAppTimer;
 let gProcess;
-let gTimeoutRuns = 0;
 
 function run_test() {
   if (APP_BIN_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
-  do_test_pending();
+  setupTestCommon(false);
+
   do_register_cleanup(end_test);
 
   if (IS_WIN) {
     Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
   }
 
-  removeUpdateDirsAndFiles();
-
   symlinkUpdateFilesIntoBundleDirectory();
   if (IS_WIN) {
     adjustPathsOnWindows();
   }
 
   if (!gAppBinPath) {
     do_throw("Main application binary not found... expected: " +
              APP_BIN_NAME + APP_BIN_SUFFIX);
@@ -90,17 +79,17 @@ function run_test() {
   }
   catch (e) {
     logTestInfo("unable to remove directory - path: " + updateTestDir.path +
                 ", exception: " + e);
   }
 
   let updatesPatchDir = getUpdatesDir();
   updatesPatchDir.append("0");
-  let mar = do_get_file("data/simple.mar");
+  let mar = getTestDirFile(FILE_SIMPLE_MAR);
   mar.copyTo(updatesPatchDir, FILE_UPDATE_ARCHIVE);
 
   // Backup the updater.ini file 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);
@@ -208,17 +197,17 @@ function end_test() {
                 ", exception: " + e);
   }
 
   if (IS_UNIX) {
     // This will delete the launch script if it exists.
     getLaunchScript();
   }
 
-  cleanUp();
+  cleanupTestCommon();
 }
 
 function shouldAdjustPathsOnMac() {
   // When running xpcshell tests locally, xpcshell and firefox-bin do not live
   // in the same directory.
   let dir = getCurrentProcessDir();
   return (IS_MACOSX && dir.leafName != "MacOS");
 }
rename from toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
--- a/toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
@@ -7,45 +7,33 @@
  * launching an application
  */
 
 /**
  * The MAR file used for this test should not contain a version 2 update
  * manifest file (e.g. updatev2.manifest).
  */
 
-const TEST_ID = "0201";
-
-// Backup the updater.ini and use a custom one to prevent the updater from
-// launching a post update executable.
-const FILE_UPDATER_INI_BAK = "updater.ini.bak";
-
-// Maximum number of milliseconds the process that is launched can run before
-// the test will try to kill it.
-const APP_TIMER_TIMEOUT = 120000;
-
 let gAppTimer;
 let gProcess;
-let gTimeoutRuns = 0;
 
 function run_test() {
   if (APP_BIN_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
-  do_test_pending();
+  setupTestCommon(false);
+
   do_register_cleanup(end_test);
 
   if (IS_WIN) {
     Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
   }
 
-  removeUpdateDirsAndFiles();
-
   symlinkUpdateFilesIntoBundleDirectory();
   if (IS_WIN) {
     adjustPathsOnWindows();
   }
 
   if (!gAppBinPath) {
     do_throw("Main application binary not found... expected: " +
              APP_BIN_NAME + APP_BIN_SUFFIX);
@@ -82,17 +70,17 @@ function run_test() {
   }
   catch (e) {
     logTestInfo("unable to remove directory - path: " + updateTestDir.path +
                 ", exception: " + e);
   }
 
   let updatesPatchDir = getUpdatesDir();
   updatesPatchDir.append("0");
-  let mar = do_get_file("data/simple.mar");
+  let mar = getTestDirFile(FILE_SIMPLE_MAR);
   mar.copyTo(updatesPatchDir, FILE_UPDATE_ARCHIVE);
 
   // Backup the updater.ini file 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);
@@ -179,17 +167,17 @@ function end_test() {
                 ", exception: " + e);
   }
 
   if (IS_UNIX) {
     // This will delete the launch script if it exists.
     getLaunchScript();
   }
 
-  cleanUp();
+  cleanupTestCommon();
 }
 
 function shouldAdjustPathsOnMac() {
   // When running xpcshell tests locally, xpcshell and firefox-bin do not live
   // in the same directory.
   let dir = getCurrentProcessDir();
   return (IS_MACOSX && dir.leafName != "MacOS");
 }
rename from toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
--- a/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
@@ -4,41 +4,29 @@
 
 /* Test applying an update by staging an update and launching an application */
 
 /**
  * The MAR file used for this test should not contain a version 2 update
  * manifest file (e.g. updatev2.manifest).
  */
 
-const TEST_ID = "0200";
-
-// Backup the updater.ini and use a custom one to prevent the updater from
-// launching a post update executable.
-const FILE_UPDATER_INI_BAK = "updater.ini.bak";
-
-// Maximum number of milliseconds the process that is launched can run before
-// the test will try to kill it.
-const APP_TIMER_TIMEOUT = 120000;
-
 let gAppTimer;
 let gProcess;
-let gTimeoutRuns = 0;
 
 function run_test() {
   if (APP_BIN_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
-  do_test_pending();
+  setupTestCommon(false);
+
   do_register_cleanup(end_test);
 
-  removeUpdateDirsAndFiles();
-
   if (!gAppBinPath) {
     do_throw("Main application binary not found... expected: " +
              APP_BIN_NAME + APP_BIN_SUFFIX);
     return;
   }
 
   gEnvSKipUpdateDirHashing = true;
   let channel = Services.prefs.getCharPref(PREF_APP_UPDATE_CHANNEL);
@@ -86,17 +74,17 @@ function run_test() {
   writeFile(file, "ToBeReplaced");
 
   file = updateTestDir.clone();
   file.append("removed-files");
   writeFile(file, "ToBeReplaced");
 
   let updatesPatchDir = getUpdatesDir();
   updatesPatchDir.append("0");
-  let mar = do_get_file("data/simple.mar");
+  let mar = getTestDirFile(FILE_SIMPLE_MAR);
   mar.copyTo(updatesPatchDir, FILE_UPDATE_ARCHIVE);
 
   // Backup the updater.ini file 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);
@@ -189,17 +177,17 @@ function end_test() {
     logTestInfo("unable to remove file during end_test. Exception: " + e);
   }
 
   if (IS_UNIX) {
     // This will delete the launch script if it exists.
     getLaunchScript();
   }
 
-  cleanUp();
+  cleanupTestCommon();
 }
 
 /**
  * Gets the directory where the update adds / removes the files contained in the
  * update.
  *
  * @return  nsIFile for the directory where the update adds / removes the files
  *          contained in the update mar.
rename from toolkit/mozapps/update/test/unit/test_0162_appInUse_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marAppInUseFallbackStageFailureComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0162_appInUse_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseFallbackStageFailureComplete_win.js
@@ -1,15 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* Application in use complete MAR file background patch apply failure fallback test */
-
-const TEST_ID = "0162";
+/* Application in use complete MAR file stage patch apply failure fallback test */
 
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
@@ -19,50 +17,50 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/partial_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "partial_removed-files"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -91,34 +89,34 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
@@ -147,18 +145,18 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not removed for failed update (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ShouldNotBeDeleted\n",
   compareContents  : "ShouldNotBeDeleted\n",
   originalFile     : null,
   compareFile      : null
@@ -179,23 +177,20 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // 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", "40"];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
@@ -206,33 +201,33 @@ function run_test() {
 function doUpdate() {
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for failure when " +
               "switching to the updated application");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_PENDING);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_PENDING);
 
   checkFilesAfterUpdateFailure(getApplyDirFile);
   checkUpdateLogContains(ERR_RENAME_FILE);
 
   logTestInfo("testing tobedeleted directory doesn't exist");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_false(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
@@ -1,15 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* Application in use complete MAR file background patch apply failure test */
-
-const TEST_ID = "0161";
+/* Application in use complete MAR file stage patch apply failure test */
 
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
@@ -19,50 +17,50 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/partial_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "partial_removed-files"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -91,34 +89,34 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
@@ -147,18 +145,18 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not removed for failed update (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ShouldNotBeDeleted\n",
   compareContents  : "ShouldNotBeDeleted\n",
   originalFile     : null,
   compareFile      : null
@@ -179,23 +177,20 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // 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", "40"];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
   callbackAppProcess.run(false, args, args.length);
@@ -206,34 +201,34 @@ function run_test() {
 function doUpdate() {
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   gDisableReplaceFallback = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for failure when " +
               "switching to the updated application");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_FAILED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   // The update status format for a failure is failed: # where # is the error
   // code for the failure.
   do_check_eq(readStatusFile(updatesDir).split(": ")[0], STATE_FAILED);
 
   checkFilesAfterUpdateFailure(getApplyDirFile);
   checkUpdateLogContains(ERR_RENAME_FILE);
 
   logTestInfo("testing tobedeleted directory doesn't exist");
rename from toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_unix_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js
--- a/toolkit/mozapps/update/test/unit/test_0161_appInUse_xp_unix_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js
@@ -1,19 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* Application in use complete MAR file background patch apply success test */
-
-const TEST_ID = "0161";
-// All we care about is that the last modified time has changed so that Mac OS
-// X Launch Services invalidates its cache so the test allows up to one minute
-// difference in the last modified time.
-const MAX_TIME_DIFFERENCE = 60000;
+/* Application in use complete MAR file stage patch apply success test */
 
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
@@ -25,18 +19,18 @@ const TEST_FILES = [
   originalPerms    : 0767,
   comparePerms     : 0767
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/complete_precomplete",
+  originalFile     : "partial_precomplete",
+  compareFile      : "complete_precomplete",
   originalPerms    : 0666,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
@@ -46,37 +40,37 @@ const TEST_FILES = [
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : null,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "partial.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/complete_removed-files",
+  originalFile     : "partial_removed-files",
+  compareFile      : "complete_removed-files",
   originalPerms    : 0666,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
@@ -87,29 +81,29 @@ const TEST_FILES = [
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "partial.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : null,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromComplete\n",
@@ -121,38 +115,38 @@ const TEST_FILES = [
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : null,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : null,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "partial.png",
+  compareFile      : "complete.png",
   originalPerms    : 0777,
   comparePerms     : 0755
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
@@ -161,18 +155,18 @@ const TEST_FILES = [
   originalPerms    : 0767,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "partial.png",
+  compareFile      : "complete.png",
   originalPerms    : 0777,
   comparePerms     : 0755
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text1",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
@@ -192,17 +186,17 @@ const TEST_FILES = [
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0776,
   comparePerms     : 0644
 }, {
   description      : "Removed by precomplete (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ToBeDeleted\n",
   compareContents  : null,
@@ -229,23 +223,20 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   let applyToDir = getApplyDirFile();
 
   // For Mac OS X set the last modified time for the root directory to a date in
   // the past to test that the last modified time is updated on a successful
   // update (bug 600098).
   if (IS_MACOSX) {
     let now = Date.now();
@@ -268,55 +259,55 @@ function run_test() {
 function doUpdate() {
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   let applyToDir = getApplyDirFile();
 
   // For Mac OS X check that the last modified time for a directory has been
   // updated after a successful update (bug 600098).
   if (IS_MACOSX) {
     logTestInfo("testing last modified time on the apply to directory has " +
                 "changed after a successful update (bug 600098)");
     let now = Date.now();
     let applyToDir = getApplyDirFile();
     let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
-    do_check_true(timeDiff < MAX_TIME_DIFFERENCE);
+    do_check_true(timeDiff < MAC_MAX_TIME_DIFFERENCE);
   }
 
   checkFilesAfterUpdateSuccess();
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "switching to the updated application");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_SUCCEEDED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_SUCCEEDED);
 
   // For Mac OS X check that the last modified time for a directory has been
   // updated after a successful update (bug 600098).
   if (IS_MACOSX) {
     logTestInfo("testing last modified time on the apply to directory has " +
                 "changed after a successful update (bug 600098)");
     let now = Date.now();
     let applyToDir = getApplyDirFile();
     let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
-    do_check_true(timeDiff < MAX_TIME_DIFFERENCE);
+    do_check_true(timeDiff < MAC_MAX_TIME_DIFFERENCE);
   }
 
   checkFilesAfterUpdateSuccess();
 
   // Make sure that the intermediate directory has been removed
   let updatedDir = applyToDir.clone();
   updatedDir.append(UPDATED_DIR_SUFFIX.replace("/", ""));
   do_check_false(updatedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js
--- a/toolkit/mozapps/update/test/unit/test_0160_appInUse_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js
@@ -1,20 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* Application in use complete MAR file patch apply success test */
 
-const TEST_ID = "0160";
-// All we care about is that the last modified time has changed so that Mac OS
-// X Launch Services invalidates its cache so the test allows up to one minute
-// difference in the last modified time.
-const MAX_TIME_DIFFERENCE = 60000;
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -25,18 +19,18 @@ const TEST_FILES = [
   originalPerms    : 0767,
   comparePerms     : 0767
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/complete_precomplete",
+  originalFile     : "partial_precomplete",
+  compareFile      : "complete_precomplete",
   originalPerms    : 0666,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
@@ -46,37 +40,37 @@ const TEST_FILES = [
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : null,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "partial.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/complete_removed-files",
+  originalFile     : "partial_removed-files",
+  compareFile      : "complete_removed-files",
   originalPerms    : 0666,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
@@ -87,29 +81,29 @@ const TEST_FILES = [
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "partial.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : null,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromComplete\n",
@@ -121,38 +115,38 @@ const TEST_FILES = [
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : null,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : null,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "partial.png",
+  compareFile      : "complete.png",
   originalPerms    : 0777,
   comparePerms     : 0755
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
@@ -161,18 +155,18 @@ const TEST_FILES = [
   originalPerms    : 0767,
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "partial.png",
+  compareFile      : "complete.png",
   originalPerms    : 0777,
   comparePerms     : 0755
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text1",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
@@ -192,17 +186,17 @@ const TEST_FILES = [
   comparePerms     : 0644
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0776,
   comparePerms     : 0644
 }, {
   description      : "Removed by precomplete (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ToBeDeleted\n",
   compareContents  : null,
@@ -229,22 +223,19 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch the callback helper application so it is in use during the update
   let callbackApp = getApplyDirFile("a/b/" + gCallbackBinFile);
   callbackApp.permissions = PERMS_DIRECTORY;
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
   let callbackAppProcess = AUS_Cc["@mozilla.org/process/util;1"].
                            createInstance(AUS_Ci.nsIProcess);
   callbackAppProcess.init(callbackApp);
@@ -272,28 +263,28 @@ function doUpdate() {
   do_check_eq(exitValue, 0);
 
   setupHelperFinish();
 }
 
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_SUCCEEDED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_SUCCEEDED);
 
   // For Mac OS X check that the last modified time for a directory has been
   // updated after a successful update (bug 600098).
   if (IS_MACOSX) {
     logTestInfo("testing last modified time on the apply to directory has " +
                 "changed after a successful update (bug 600098)");
     let now = Date.now();
     let applyToDir = getApplyDirFile();
     let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
-    do_check_true(timeDiff < MAX_TIME_DIFFERENCE);
+    do_check_true(timeDiff < MAC_MAX_TIME_DIFFERENCE);
   }
 
   checkFilesAfterUpdateSuccess();
 
   if (IS_WIN) {
     logTestInfo("testing tobedeleted directory doesn't exist");
     let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
     do_check_false(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0152_appBinReplaced_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0152_appBinReplaced_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessComplete_win.js
@@ -1,16 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* Replace app binary complete MAR file background patch apply success test */
-
-const TEST_ID = "0152";
-const MAR_COMPLETE_WIN_FILE = "data/complete_win.mar";
+/* Replace app binary complete MAR file stage patch apply success test */
 
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
@@ -20,77 +17,77 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/complete_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "complete_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "partial.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/complete_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "complete_removed-files"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "partial.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
@@ -98,50 +95,50 @@ const TEST_FILES = [
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_after.exe",
-  compareFile      : "data/partial_in_use_win_before.exe"
+  originalFile     : "partial_in_use_win_after.exe",
+  compareFile      : "partial_in_use_win_before.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_after.exe",
-  compareFile      : "data/partial_in_use_win_before.exe"
+  originalFile     : "partial_in_use_win_after.exe",
+  compareFile      : "partial_in_use_win_before.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text1",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
@@ -155,17 +152,17 @@ const TEST_FILES = [
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Removed by precomplete (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ToBeDeleted\n",
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -186,34 +183,31 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_COMPLETE_WIN_FILE);
+  setupUpdaterTest(FILE_COMPLETE_WIN_MAR);
 
   gCallbackBinFile = "exe0.exe";
 
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "switching to the updated application");
rename from toolkit/mozapps/update/test/unit/test_0153_appBinPatched_xp_win_partial.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js
--- a/toolkit/mozapps/update/test/unit/test_0153_appBinPatched_xp_win_partial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js
@@ -1,16 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* Patch app binary partial MAR file background patch apply success test */
-
-const TEST_ID = "0153";
-const MAR_IN_USE_WIN_FILE = "data/partial_win.mar";
+/* Patch app binary partial MAR file stage patch apply success test */
 
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
@@ -20,146 +17,146 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "complete_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_after.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_after.exe"
 }, {
   description      : "Patched by update.manifest (patch) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_after.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_after.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text0",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "20png0.png",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/partial.png"
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text2",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
@@ -188,34 +185,31 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_IN_USE_WIN_FILE);
+  setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   gCallbackBinFile = "exe0.exe";
 
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a partial mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "switching to the updated application");
rename from toolkit/mozapps/update/test/unit/test_0150_appBinReplaced_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0150_appBinReplaced_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessComplete_win.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* Replace app binary complete MAR file patch apply success test */
 
-const TEST_ID = "0150";
-const MAR_COMPLETE_WIN_FILE = "data/complete_win.mar";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -20,77 +17,77 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/complete_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "complete_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "partial.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/complete_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "complete_removed-files"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "partial.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
@@ -98,50 +95,50 @@ const TEST_FILES = [
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_after.exe",
-  compareFile      : "data/partial_in_use_win_before.exe"
+  originalFile     : "partial_in_use_win_after.exe",
+  compareFile      : "partial_in_use_win_before.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_after.exe",
-  compareFile      : "data/partial_in_use_win_before.exe"
+  originalFile     : "partial_in_use_win_after.exe",
+  compareFile      : "partial_in_use_win_before.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text1",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
@@ -155,17 +152,17 @@ const TEST_FILES = [
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Removed by precomplete (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ToBeDeleted\n",
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -186,33 +183,30 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  setupUpdaterTest(MAR_COMPLETE_WIN_FILE);
+  setupUpdaterTest(FILE_COMPLETE_WIN_MAR);
 
   gCallbackBinFile = "exe0.exe";
 
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_SUCCEEDED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_SUCCEEDED);
 
   checkFilesAfterUpdateSuccess();
 
   logTestInfo("testing tobedeleted directory doesn't exist");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_false(toBeDeletedDir.exists());
 
rename from toolkit/mozapps/update/test/unit/test_0151_appBinPatched_xp_win_partial.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessPartial_win.js
--- a/toolkit/mozapps/update/test/unit/test_0151_appBinPatched_xp_win_partial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessPartial_win.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* Patch app binary partial MAR file patch apply success test */
 
-const TEST_ID = "0151";
-const MAR_IN_USE_WIN_FILE = "data/partial_win.mar";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -20,146 +17,146 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "complete_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_after.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_after.exe"
 }, {
   description      : "Patched by update.manifest (patch) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_after.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_after.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text0",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "20png0.png",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/partial.png"
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text2",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
@@ -188,33 +185,30 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  setupUpdaterTest(MAR_IN_USE_WIN_FILE);
+  setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   gCallbackBinFile = "exe0.exe";
 
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a partial mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_SUCCEEDED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_SUCCEEDED);
 
   checkFilesAfterUpdateSuccess();
 
   logTestInfo("testing tobedeleted directory doesn't exist");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_false(toBeDeletedDir.exists());
 
rename from toolkit/mozapps/update/test/unit/test_0202_app_launch_apply_update_dirlocked.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marDirLockedStageFailure_win.js
--- a/toolkit/mozapps/update/test/unit/test_0202_app_launch_apply_update_dirlocked.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marDirLockedStageFailure_win.js
@@ -13,37 +13,28 @@
  * check if the alternate updated directory logic works correctly.
  */
 
 /**
  * The MAR file used for this test should not contain a version 2 update
  * manifest file (e.g. updatev2.manifest).
  */
 
-const TEST_ID = "0202";
-
-// Backup the updater.ini and use a custom one to prevent the updater from
-// launching a post update executable.
-const FILE_UPDATER_INI_BAK = "updater.ini.bak";
-
-let gTimeoutRuns = 0;
-
 function run_test() {
   if (APP_BIN_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
-  do_test_pending();
+  setupTestCommon(false);
+
   do_register_cleanup(end_test);
 
   logTestInfo("setting up environment for the update test...");
 
-  removeUpdateDirsAndFiles();
-
   symlinkUpdateFilesIntoBundleDirectory();
   if (IS_WIN) {
     adjustPathsOnWindows();
   }
 
   if (!gAppBinPath) {
     do_throw("Main application binary not found... expected: " +
              APP_BIN_NAME + APP_BIN_SUFFIX);
@@ -87,17 +78,17 @@ function run_test() {
   }
   catch (e) {
     logTestInfo("unable to remove directory - path: " + updateTestDir.path +
                 ", exception: " + e);
   }
 
   let updatesPatchDir = getUpdatesDir();
   updatesPatchDir.append("0");
-  let mar = do_get_file("data/simple.mar");
+  let mar = getTestDirFile(FILE_SIMPLE_MAR);
   mar.copyTo(updatesPatchDir, FILE_UPDATE_ARCHIVE);
 
   // Backup the updater.ini file 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);
@@ -161,17 +152,17 @@ function end_test() {
                 ", exception: " + e);
   }
 
   if (IS_UNIX) {
     // This will delete the launch script if it exists.
     getLaunchScript();
   }
 
-  cleanUp();
+  cleanupTestCommon();
   logTestInfo("finish - test cleanup");
 }
 
 function shouldAdjustPathsOnMac() {
   // When running xpcshell tests locally, xpcshell and firefox-bin do not live
   // in the same directory.
   let dir = getCurrentProcessDir();
   return (IS_MACOSX && dir.leafName != "MacOS");
rename from toolkit/mozapps/update/test/unit/test_0112_general.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFailurePartial.js
--- a/toolkit/mozapps/update/test/unit/test_0112_general.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFailurePartial.js
@@ -1,21 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 /* General Partial MAR File Patch Apply Failure Test */
 
-const TEST_ID = "0112";
-// All we care about is that the last modified time has changed so that Mac OS
-// X Launch Services invalidates its cache so the test allows up to one minute
-// difference in the last modified time.
-const MAX_TIME_DIFFERENCE = 60000;
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -26,18 +20,18 @@ const TEST_FILES = [
   originalPerms    : 0767,
   comparePerms     : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete_precomplete",
-  compareFile      : "data/complete_precomplete",
+  originalFile     : "complete_precomplete",
+  compareFile      : "complete_precomplete",
   originalPerms    : 0666,
   comparePerms     : 0666
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
@@ -46,28 +40,28 @@ const TEST_FILES = [
   originalPerms    : 0775,
   comparePerms     : 0775
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0666
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0666
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
@@ -76,28 +70,28 @@ const TEST_FILES = [
   originalPerms    : null,
   comparePerms     : null
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0666
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0666
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
@@ -106,49 +100,49 @@ const TEST_FILES = [
   originalPerms    : 0644,
   comparePerms     : 0644
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0644,
   comparePerms     : 0644
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0644,
   comparePerms     : 0644
 }, {
   description      : "Not patched for failed update (patch)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0755,
   comparePerms     : 0755
 }, {
   description      : "Not patched for failed update (patch) and causes " +
                      "LoadSourceFile failed",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png",
+  originalFile     : "partial.png",
+  compareFile      : "partial.png",
   originalPerms    : 0755,
   comparePerms     : 0755
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "00text0",
   relPathDir       : "a/b/0/00/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
@@ -157,18 +151,18 @@ const TEST_FILES = [
   originalPerms    : null,
   comparePerms     : null
 }, {
   description      : "Not patched for failed update (patch)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png",
+  originalFile     : "complete.png",
+  compareFile      : "complete.png",
   originalPerms    : 0666,
   comparePerms     : 0666
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : null,
@@ -225,24 +219,21 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupUpdaterTest(FILE_PARTIAL_MAR);
 
-  setupUpdaterTest(MAR_PARTIAL_FILE);
-
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   let applyToDir = getApplyDirFile();
 
   // For Mac OS X set the last modified time for the root directory to a date in
   // the past to test that the last modified time is updated on all updates since
   // the precomplete file in the root of the bundle is renamed, etc. (bug 600098).
   if (IS_MACOSX) {
     let now = Date.now();
     let yesterday = now - (1000 * 60 * 60 * 24);
@@ -263,17 +254,17 @@ function run_test() {
 
   // For Mac OS X check that the last modified time for a directory has been
   // updated after a successful update (bug 600098).
   if (IS_MACOSX) {
     logTestInfo("testing last modified time on the apply to directory has " +
                 "changed after a successful update (bug 600098)");
     let now = Date.now();
     let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
-    do_check_true(timeDiff < MAX_TIME_DIFFERENCE);
+    do_check_true(timeDiff < MAC_MAX_TIME_DIFFERENCE);
   }
 
   checkFilesAfterUpdateFailure();
   // Sorting on Linux is different so skip this check for now.
   if (!IS_UNIX) {
     checkUpdateLogContents(LOG_PARTIAL_FAILURE);
   }
 
rename from toolkit/mozapps/update/test/unit/test_0188_fileInUse_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailureComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0188_fileInUse_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailureComplete_win.js
@@ -1,16 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File in use complete MAR file background patch apply failure fallback test */
 
-const TEST_ID = "0188";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -19,18 +17,18 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "ToBeReplacedWithFromComplete\n",
   originalFile     : null,
   compareFile      : null
@@ -43,44 +41,44 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/partial_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "partial_removed-files"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
@@ -113,34 +111,34 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : HELPER_BIN_FILE,
-  compareFile      : HELPER_BIN_FILE
+  originalFile     : FILE_HELPER_BIN,
+  compareFile      : FILE_HELPER_BIN
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "ToBeReplacedWithFromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : HELPER_BIN_FILE,
-  compareFile      : HELPER_BIN_FILE
+  originalFile     : FILE_HELPER_BIN,
+  compareFile      : FILE_HELPER_BIN
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text1",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "ToBeReplacedWithFromComplete\n",
   originalFile     : null,
   compareFile      : null
@@ -185,23 +183,20 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
@@ -213,33 +208,33 @@ function run_test() {
 function doUpdate() {
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for failure when " +
               "switching to the updated application");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_PENDING);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_PENDING);
 
   checkFilesAfterUpdateFailure(getApplyDirFile);
   checkUpdateLogContains(ERR_RENAME_FILE);
 
   logTestInfo("testing tobedeleted directory does not exist");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_false(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0189_fileInUse_xp_win_partial.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailurePartial_win.js
--- a/toolkit/mozapps/update/test/unit/test_0189_fileInUse_xp_win_partial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseFallbackStageFailurePartial_win.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File in use partial MAR file background patch apply failure fallback test */
 
-const TEST_ID = "0189";
-const MAR_IN_USE_WIN_FILE = "data/partial_win.mar";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -20,130 +17,130 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete_precomplete",
-  compareFile      : "data/complete_precomplete"
+  originalFile     : "complete_precomplete",
+  compareFile      : "complete_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "ToBeReplacedWithFromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "ToBeReplacedWithFromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_before.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_before.exe"
 }, {
   description      : "Patched by update.manifest (patch) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_before.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_before.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text0",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "ToBeReplacedWithFromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -188,23 +185,20 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_IN_USE_WIN_FILE);
+  setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
@@ -216,33 +210,33 @@ function run_test() {
 function doUpdate() {
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for failure when " +
               "switching to the updated application");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_PENDING);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_PENDING);
 
   checkFilesAfterUpdateFailure(getApplyDirFile);
   checkUpdateLogContains(ERR_RENAME_FILE);
 
   logTestInfo("testing tobedeleted directory does not exist");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_false(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0184_fileInUse_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0184_fileInUse_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessComplete_win.js
@@ -1,16 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File in use complete MAR file background patch apply success test */
 
-const TEST_ID = "0184";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -19,18 +17,18 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "ToBeReplacedWithFromComplete\n",
   originalFile     : null,
   compareFile      : null
@@ -43,44 +41,44 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/partial_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "partial_removed-files"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
@@ -113,34 +111,34 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : HELPER_BIN_FILE,
-  compareFile      : HELPER_BIN_FILE
+  originalFile     : FILE_HELPER_BIN,
+  compareFile      : FILE_HELPER_BIN
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "ToBeReplacedWithFromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : HELPER_BIN_FILE,
-  compareFile      : HELPER_BIN_FILE
+  originalFile     : FILE_HELPER_BIN,
+  compareFile      : FILE_HELPER_BIN
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text1",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "ToBeReplacedWithFromComplete\n",
   originalFile     : null,
   compareFile      : null
@@ -185,23 +183,20 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
@@ -213,34 +208,34 @@ function run_test() {
 function doUpdate() {
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   gDisableReplaceFallback = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for failure when " +
               "switching to the updated application");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_FAILED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir).split(": ")[0], STATE_FAILED);
 
   checkFilesAfterUpdateFailure(getApplyDirFile);
   checkUpdateLogContains(ERR_RENAME_FILE);
 
   logTestInfo("testing tobedeleted directory does not exist");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_false(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0185_fileInUse_xp_win_partial.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessPartial_win.js
--- a/toolkit/mozapps/update/test/unit/test_0185_fileInUse_xp_win_partial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageSuccessPartial_win.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File in use partial MAR file background patch apply success test */
 
-const TEST_ID = "0185";
-const MAR_IN_USE_WIN_FILE = "data/partial_win.mar";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -20,130 +17,130 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete_precomplete",
-  compareFile      : "data/complete_precomplete"
+  originalFile     : "complete_precomplete",
+  compareFile      : "complete_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "ToBeReplacedWithFromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "ToBeReplacedWithFromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_before.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_before.exe"
 }, {
   description      : "Patched by update.manifest (patch) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_before.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_before.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text0",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "ToBeReplacedWithFromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -188,23 +185,20 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_IN_USE_WIN_FILE);
+  setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40"];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
@@ -216,34 +210,34 @@ function run_test() {
 function doUpdate() {
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for success when " +
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   logTestInfo("testing update.status should be " + STATE_APPLIED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_APPLIED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   gDisableReplaceFallback = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for failure when " +
               "switching to the updated application");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_FAILED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir).split(": ")[0], STATE_FAILED);
 
   checkFilesAfterUpdateFailure(getApplyDirFile);
   checkUpdateLogContains(ERR_RENAME_FILE);
 
   logTestInfo("testing tobedeleted directory does not exist");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_false(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js
@@ -1,16 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File in use complete MAR file patch apply success test */
 
-const TEST_ID = "0180";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -19,77 +17,77 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/complete_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "complete_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "partial.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/complete_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "complete_removed-files"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "partial.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
@@ -97,50 +95,50 @@ const TEST_FILES = [
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : HELPER_BIN_FILE,
-  compareFile      : "data/complete.png"
+  originalFile     : FILE_HELPER_BIN,
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : HELPER_BIN_FILE,
-  compareFile      : "data/complete.png"
+  originalFile     : FILE_HELPER_BIN,
+  compareFile      : "complete.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text1",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromComplete\n",
   compareContents  : "FromComplete\n",
   originalFile     : null,
   compareFile      : null
@@ -154,17 +152,17 @@ const TEST_FILES = [
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/complete.png"
+  compareFile      : "complete.png"
 }, {
   description      : "Removed by precomplete (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ToBeDeleted\n",
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -185,22 +183,19 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by precomplete (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Launch an existing file so it is in use during the update
   let fileInUseBin = getApplyDirFile(TEST_FILES[14].relPathDir +
                                      TEST_FILES[14].fileName);
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
@@ -216,17 +211,17 @@ function doUpdate() {
               "applying a complete mar");
   do_check_eq(exitValue, 0);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_SUCCEEDED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_SUCCEEDED);
 
   checkFilesAfterUpdateSuccess();
   checkUpdateLogContains(ERR_BACKUP_DISCARD);
 
   logTestInfo("testing tobedeleted directory exists");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_true(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js
--- a/toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js
@@ -1,17 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File in use partial MAR file patch apply success test */
 
-const TEST_ID = "0181";
-const MAR_IN_USE_WIN_FILE = "data/partial_win.mar";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -20,146 +17,146 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "complete_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the file exists " +
                      "(patch-if)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest if the parent directory " +
                      "exists (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest if the parent directory " +
                      "exists (patch-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_after.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_after.exe"
 }, {
   description      : "Patched by update.manifest (patch) file in use",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_in_use_win_before.exe",
-  compareFile      : "data/partial_in_use_win_after.exe"
+  originalFile     : "partial_in_use_win_before.exe",
+  compareFile      : "partial_in_use_win_after.exe"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text0",
   relPathDir       : "a/b/0/00/",
   originalContents : "ToBeReplacedWithFromPartial\n",
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Patched by update.manifest (patch)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "complete.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "20png0.png",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
-  compareFile      : "data/partial.png"
+  compareFile      : "partial.png"
 }, {
   description      : "Added by update.manifest (add)",
   fileName         : "00text2",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : "FromPartial\n",
   originalFile     : null,
   compareFile      : null
@@ -188,22 +185,19 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : true
 }, {
   description  : "Removed by update.manifest (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : true
 }];
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  setupUpdaterTest(MAR_IN_USE_WIN_FILE);
+  setupUpdaterTest(FILE_PARTIAL_WIN_MAR);
 
   // Launch an existing file so it is in use during the update
   let fileInUseBin = getApplyDirFile(TEST_FILES[12].relPathDir +
                                      TEST_FILES[12].fileName);
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20"];
   let fileInUseProcess = AUS_Cc["@mozilla.org/process/util;1"].
                          createInstance(AUS_Ci.nsIProcess);
   fileInUseProcess.init(fileInUseBin);
@@ -219,17 +213,17 @@ function doUpdate() {
               "applying a partial mar");
   do_check_eq(exitValue, 0);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_SUCCEEDED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_SUCCEEDED);
 
   checkFilesAfterUpdateSuccess();
   checkUpdateLogContains(ERR_BACKUP_DISCARD);
 
   logTestInfo("testing tobedeleted directory exists");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_true(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js
@@ -1,16 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File locked complete MAR file patch apply failure test */
 
-const TEST_ID = "0170";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -19,50 +17,50 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/partial_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "partial_removed-files"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -91,34 +89,34 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
@@ -147,18 +145,18 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not removed for failed update (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ShouldNotBeDeleted\n",
   compareContents  : "ShouldNotBeDeleted\n",
   originalFile     : null,
   compareFile      : null
@@ -179,28 +177,25 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Exclusively lock an existing file so it is in use during the update
-  let helperBin = do_get_file(HELPER_BIN_FILE);
+  let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let helperDestDir = getApplyDirFile("a/b/");
-  helperBin.copyTo(helperDestDir, HELPER_BIN_FILE);
-  helperBin = getApplyDirFile("a/b/" + HELPER_BIN_FILE);
+  helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
+  helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20", lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
@@ -217,17 +212,17 @@ function doUpdate() {
               "applying a complete mar");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_FAILED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   // The update status format for a failure is failed: # where # is the error
   // code for the failure.
   do_check_eq(readStatusFile(updatesDir).split(": ")[0], STATE_FAILED);
 
   checkFilesAfterUpdateFailure();
   checkUpdateLogContains(ERR_RENAME_FILE);
 
   logTestInfo("testing tobedeleted directory doesn't exist");
rename from toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js
--- a/toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js
@@ -1,16 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* File locked partial MAR file patch apply failure test */
 
-const TEST_ID = "0171";
-
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
   relPathDir       : "a/b/defaults/pref/",
@@ -19,123 +17,123 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete_precomplete",
-  compareFile      : "data/complete_precomplete"
+  originalFile     : "complete_precomplete",
+  compareFile      : "complete_precomplete"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "extensions1png1.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "extensions1png0.png",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0text0",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Not patched for failed update (patch)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Not patched for failed update (patch) and causes " +
                      "LoadSourceFile failed",
   fileName         : "0exe0.exe",
   relPathDir       : "a/b/0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "00text0",
   relPathDir       : "a/b/0/00/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not patched for failed update (patch)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  compareFile      : "complete.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -180,28 +178,25 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/1/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  do_test_pending();
+  setupTestCommon(true);
 
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
-
-  setupUpdaterTest(MAR_PARTIAL_FILE);
+  setupUpdaterTest(FILE_PARTIAL_MAR);
 
   // Exclusively lock an existing file so it is in use during the update
-  let helperBin = do_get_file(HELPER_BIN_FILE);
+  let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let helperDestDir = getApplyDirFile("a/b/");
-  helperBin.copyTo(helperDestDir, HELPER_BIN_FILE);
-  helperBin = getApplyDirFile("a/b/" + HELPER_BIN_FILE);
+  helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
+  helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "20", lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
@@ -218,17 +213,17 @@ function doUpdate() {
               "applying a partial mar");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_FAILED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   // The update status format for a failure is failed: # where # is the error
   // code for the failure.
   do_check_eq(readStatusFile(updatesDir).split(": ")[0], STATE_FAILED);
 
   checkFilesAfterUpdateFailure();
   checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);
 
   logTestInfo("testing tobedeleted directory doesn't exist");
rename from toolkit/mozapps/update/test/unit/test_0174_fileLocked_xp_win_complete.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailureComplete_win.js
--- a/toolkit/mozapps/update/test/unit/test_0174_fileLocked_xp_win_complete.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailureComplete_win.js
@@ -1,15 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* File locked complete MAR file background patch apply failure fallback test */
-
-const TEST_ID = "0174";
+/* File locked complete MAR file stage patch apply failure fallback test */
 
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
@@ -19,50 +17,50 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_precomplete",
-  compareFile      : "data/partial_precomplete"
+  originalFile     : "partial_precomplete",
+  compareFile      : "partial_precomplete"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginspng0.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "removed-files",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial_removed-files",
-  compareFile      : "data/partial_removed-files"
+  originalFile     : "partial_removed-files",
+  compareFile      : "partial_removed-files"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions1text0",
   relPathDir       : "a/b/extensions/extensions1/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
@@ -91,34 +89,34 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0png1.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add-if)",
   fileName         : "extensions0png0.png",
   relPathDir       : "a/b/extensions/extensions0/",
   originalContents : null,
   compareContents  : null,
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "exe0.exe",
   relPathDir       : "a/b/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "10text0",
   relPathDir       : "a/b/1/10/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
@@ -147,18 +145,18 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "00png0.png",
   relPathDir       : "a/b/0/00/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/partial.png",
-  compareFile      : "data/partial.png"
+  originalFile     : "partial.png",
+  compareFile      : "partial.png"
 }, {
   description      : "Not removed for failed update (remove)",
   fileName         : "20text0",
   relPathDir       : "a/b/2/20/",
   originalContents : "ShouldNotBeDeleted\n",
   compareContents  : "ShouldNotBeDeleted\n",
   originalFile     : null,
   compareFile      : null
@@ -179,29 +177,26 @@ ADDITIONAL_TEST_DIRS = [
   dirRemoved   : false
 }, {
   description  : "Not removed for failed update (rmdir)",
   relPathDir   : "a/b/2/",
   dirRemoved   : false
 }];
 
 function run_test() {
-  do_test_pending();
-
-  // adjustGeneralPaths registers a cleanup function that calls end_test.
-  adjustGeneralPaths();
+  setupTestCommon(true);
 
   gBackgroundUpdate = true;
-  setupUpdaterTest(MAR_COMPLETE_FILE);
+  setupUpdaterTest(FILE_COMPLETE_MAR);
 
   // Exclusively lock an existing file so it is in use during the update
-  let helperBin = do_get_file(HELPER_BIN_FILE);
+  let helperBin = getTestDirFile(FILE_HELPER_BIN);
   let helperDestDir = getApplyDirFile("a/b/");
-  helperBin.copyTo(helperDestDir, HELPER_BIN_FILE);
-  helperBin = getApplyDirFile("a/b/" + HELPER_BIN_FILE);
+  helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
+  helperBin = getApplyDirFile("a/b/" + FILE_HELPER_BIN);
   // Strip off the first two directories so the path has to be from the helper's
   // working directory.
   let lockFileRelPath = TEST_FILES[3].relPathDir.split("/");
   lockFileRelPath = lockFileRelPath.slice(2);
   lockFileRelPath = lockFileRelPath.join("/") + "/" + TEST_FILES[3].fileName;
   let args = [getApplyDirPath() + "a/b/", "input", "output", "-s", "40", lockFileRelPath];
   let lockFileProcess = AUS_Cc["@mozilla.org/process/util;1"].
                      createInstance(AUS_Ci.nsIProcess);
@@ -214,33 +209,33 @@ function run_test() {
 function doUpdate() {
   // apply the complete mar
   let exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for failure when " +
               "applying a complete mar");
   do_check_eq(exitValue, 1);
 
   logTestInfo("testing update.status should be " + STATE_FAILED);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir).split(": ")[0], STATE_FAILED);
 
   // Now switch the application and its updated version
   gBackgroundUpdate = false;
   gSwitchApp = true;
   exitValue = runUpdate();
   logTestInfo("testing updater binary process exitValue for failure when " +
               "switching to the updated application");
   do_check_eq(exitValue, 1);
 
   setupHelperFinish();
 }
 
 function checkUpdate() {
   logTestInfo("testing update.status should be " + STATE_PENDING);
-  let updatesDir = do_get_file(TEST_ID + UPDATES_DIR_SUFFIX);
+  let updatesDir = do_get_file(gTestID + UPDATES_DIR_SUFFIX);
   do_check_eq(readStatusFile(updatesDir), STATE_PENDING);
 
   checkFilesAfterUpdateFailure(getApplyDirFile);
   checkUpdateLogContains(ERR_RENAME_FILE);
 
   logTestInfo("testing tobedeleted directory doesn't exist");
   let toBeDeletedDir = getApplyDirFile("tobedeleted", true);
   do_check_false(toBeDeletedDir.exists());
rename from toolkit/mozapps/update/test/unit/test_0175_fileLocked_xp_win_partial.js
rename to toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailurePartial_win.js
--- a/toolkit/mozapps/update/test/unit/test_0175_fileLocked_xp_win_partial.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFallbackStageFailurePartial_win.js
@@ -1,15 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* File locked partial MAR file background patch apply failure fallback test */
-
-const TEST_ID = "0175";
+/* File locked partial MAR file stage patch apply failure fallback test */
 
 // The files are listed in the same order as they are applied from the mar's
 // update.manifest. Complete updates have remove file and rmdir directory
 // operations located in the precomplete file performed first.
 const TEST_FILES = [
 {
   description      : "Should never change",
   fileName         : "channel-prefs.js",
@@ -19,123 +17,123 @@ const TEST_FILES = [
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "precomplete",
   relPathDir       : "",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete_precomplete",
-  compareFile      : "data/complete_precomplete"
+  originalFile     : "complete_precomplete",
+  compareFile      : "complete_precomplete"
 }, {
   description      : "Not added for failed update (add)",
   fileName         : "searchpluginstext0",
   relPathDir       : "a/b/searchplugins/",
   originalContents : "ShouldNotBeReplaced\n",
   compareContents  : "ShouldNotBeReplaced\n",
   originalFile     : null,
   compareFile      : null
 }, {
   description      : "Not patched for failed update (patch-if)",
   fileName         : "searchpluginspng1.png",
   relPathDir       : "a/b/searchplugins/",
   originalContents : null,
   compareContents  : null,
-  originalFile     : "data/complete.png",
-  compareFile      : "data/complete.png"
+  originalFile     : "complete.png",
+  com