Bug 481815 - Make sure that the maintenance service tests are only run when the service is enabled. r=rstrong.
--- a/testing/xpcshell/xpcshell.ini
+++ b/testing/xpcshell/xpcshell.ini
@@ -33,16 +33,17 @@ skip-if = os == "android"
[include:toolkit/components/downloads/test/unit/xpcshell.ini]
[include:toolkit/components/downloads/test/schema_migration/xpcshell.ini]
[include:toolkit/components/telemetry/tests/unit/xpcshell.ini]
[include:toolkit/content/tests/unit/xpcshell.ini]
[include:toolkit/mozapps/downloads/tests/unit/xpcshell.ini]
[include:toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini]
[include:toolkit/mozapps/extensions/test/xpcshell-unpack/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:security/manager/ssl/tests/unit/xpcshell.ini]
[include:testing/xpcshell/example/unit/xpcshell.ini]
[include:xpcom/tests/unit/xpcshell.ini]
[include:modules/libpref/test/unit/xpcshell.ini]
[include:intl/strres/tests/unit/xpcshell.ini]
[include:intl/unicharutil/tests/unit/xpcshell.ini]
[include:intl/uconv/tests/unit/xpcshell.ini]
--- a/toolkit/mozapps/update/Makefile.in
+++ b/toolkit/mozapps/update/Makefile.in
@@ -65,12 +65,15 @@ EXTRA_PP_COMPONENTS += \
$(NULL)
endif
ifdef ENABLE_TESTS
DIRS += test_timermanager
# Update tests require the updater binary
ifdef MOZ_UPDATER
DIRS += test
+ifdef MOZ_MAINTENANCE_SERVICE
+DIRS += test_svc
+endif
endif
endif
include $(topsrcdir)/config/rules.mk
--- a/toolkit/mozapps/update/test/unit/xpcshell.ini
+++ b/toolkit/mozapps/update/test/unit/xpcshell.ini
@@ -23,11 +23,8 @@ tail =
skip-if = os == 'android'
; Platform-specific updater tests
[include:xpcshell_updater_windows.ini]
run-if = os == 'win'
[include:xpcshell_updater_xp_unix.ini]
run-if = os == 'linux' || os == 'mac'
[test_bug497578.js]
[test_bug595059.js]
-; Tests using the maintenance service
-[include:xpcshell_updater_windows_svc.ini]
-run-if = os == 'win'
copy from toolkit/mozapps/update/test/Makefile.in
copy to toolkit/mozapps/update/test_svc/Makefile.in
--- a/toolkit/mozapps/update/test/Makefile.in
+++ b/toolkit/mozapps/update/test_svc/Makefile.in
@@ -9,20 +9,20 @@
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Application Update Service.
#
# The Initial Developer of the Original Code is
-# Robert Strong <robert.bugzilla@gmail.com>.
+# Ehsan Akhgari <ehsan@mozilla.com>.
#
-# Portions created by the Initial Developer are Copyright (C) 2008
-# the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
+# Portions created by the Initial Developer are Copyright (C) 2011
+# the Mozilla Foundation. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
@@ -34,91 +34,38 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
-relativesrcdir = toolkit/mozapps/update/test
+relativesrcdir = toolkit/mozapps/update/test_svc
include $(DEPTH)/config/autoconf.mk
XPCSHELL_TESTS = \
unit \
$(NULL)
TESTROOT = $(call core_abspath,$(DEPTH))/_tests/xpcshell/$(relativesrcdir)
DEFINES += \
-DAB_CD=$(AB_CD) \
-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-DBIN_SUFFIX=$(BIN_SUFFIX) \
-DNS_NO_XPCOM \
$(NULL)
-# Android doesn't build the updater binary, so it skips the things that test it.
-ifneq ($(OS_TARGET),Android)
-DIRS = \
- chrome \
- $(NULL)
-
-CPPSRCS = \
- TestAUSReadStrings.cpp \
- TestAUSHelper.cpp \
- $(NULL)
-
-SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX))
-
-INI_TEST_FILES = \
- TestAUSReadStrings1.ini \
- TestAUSReadStrings2.ini \
- TestAUSReadStrings3.ini \
- $(NULL)
-
-LOCAL_INCLUDES += \
- -I$(srcdir) \
- -I$(topsrcdir)/toolkit/mozapps/update \
- -I$(topsrcdir)/toolkit/mozapps/update/common \
- $(NULL)
-
-MOZ_WINCONSOLE = 1
-
-LIBS += \
- ../../readstrings/$(LIB_PREFIX)readstrings.$(LIB_SUFFIX) \
- $(NULL)
-
-ifeq ($(OS_ARCH),WINNT)
-USE_STATIC_LIBS = 1
-DEFINES += -DUNICODE -D_UNICODE
-endif
-endif # Not Android
-
include $(topsrcdir)/config/rules.mk
-ifneq ($(OS_TARGET),Android)
-# TestAUSReadStrings runs during check in the following directory with a Unicode
-# char in order to test bug 473417 on Windows.
-ifeq ($(OS_ARCH),WINNT)
-bug473417dir = test_bug473417-ó
-else
-bug473417dir = test_bug473417
-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
+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) TestAUSHelper$(BIN_SUFFIX) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
+ $(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
rename from toolkit/mozapps/update/test/unit/test_0000_bootstrap_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0000_bootstrap_svc.js
rename from toolkit/mozapps/update/test/unit/test_0110_general_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0110_general_svc.js
rename from toolkit/mozapps/update/test/unit/test_0111_general_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0111_general_svc.js
rename from toolkit/mozapps/update/test/unit/test_0112_general_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0112_general_svc.js
rename from toolkit/mozapps/update/test/unit/test_0120_channelChange_complete_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0120_channelChange_complete_svc.js
rename from toolkit/mozapps/update/test/unit/test_0150_appBinReplaced_xp_win_complete_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0150_appBinReplaced_xp_win_complete_svc.js
rename from toolkit/mozapps/update/test/unit/test_0151_appBinPatched_xp_win_partial_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0151_appBinPatched_xp_win_partial_svc.js
rename from toolkit/mozapps/update/test/unit/test_0160_appInUse_xp_win_complete_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0160_appInUse_xp_win_complete_svc.js
rename from toolkit/mozapps/update/test/unit/test_0170_fileLocked_xp_win_complete_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0170_fileLocked_xp_win_complete_svc.js
rename from toolkit/mozapps/update/test/unit/test_0171_fileLocked_xp_win_partial_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0171_fileLocked_xp_win_partial_svc.js
rename from toolkit/mozapps/update/test/unit/test_0180_fileInUse_xp_win_complete_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0180_fileInUse_xp_win_complete_svc.js
rename from toolkit/mozapps/update/test/unit/test_0181_fileInUse_xp_win_partial_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0181_fileInUse_xp_win_partial_svc.js
rename from toolkit/mozapps/update/test/unit/test_0182_rmrfdirFileInUse_xp_win_complete_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0182_rmrfdirFileInUse_xp_win_complete_svc.js
rename from toolkit/mozapps/update/test/unit/test_0183_rmrfdirFileInUse_xp_win_partial_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0183_rmrfdirFileInUse_xp_win_partial_svc.js
rename from toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update_svc.js
rename to toolkit/mozapps/update/test_svc/unit/test_0200_app_launch_apply_update_svc.js
rename from toolkit/mozapps/update/test/unit/xpcshell_updater_windows_svc.ini
rename to toolkit/mozapps/update/test_svc/unit/xpcshell.ini
--- a/toolkit/mozapps/update/test/unit/xpcshell_updater_windows_svc.ini
+++ b/toolkit/mozapps/update/test_svc/unit/xpcshell.ini
@@ -1,8 +1,12 @@
+[DEFAULT]
+head = head_update.js
+tail =
+
[test_0000_bootstrap_svc.js]
[test_0110_general_svc.js]
[test_0111_general_svc.js]
[test_0112_general_svc.js]
[test_0120_channelChange_complete_svc.js]
[test_0150_appBinReplaced_xp_win_complete_svc.js]
[test_0151_appBinPatched_xp_win_partial_svc.js]
[test_0160_appInUse_xp_win_complete_svc.js]