Bug 948278 - Avoid piggy-backing into the build system for the reftest addon. r=ted

This makes the reftest addon use the httpd server as a js module instead of
a XPCOM component.
This commit is contained in:
Mike Hommey 2014-12-16 15:07:01 +09:00
Родитель b91168c141
Коммит 541c80f735
10 изменённых файлов: 24 добавлений и 69 удалений

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

@ -3,30 +3,14 @@
# 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/.
ifdef XPI_NAME
NO_JS_MANIFEST = 1
DIST_FILES = install.rdf
ifeq ($(MOZ_BUILD_APP),mobile/android)
DEFINES += -DBOOTSTRAP
DIST_FILES += bootstrap.js
endif
ifeq ($(MOZ_BUILD_APP),b2g/dev)
DEFINES += -DBOOTSTRAP
DEFINES += -DREFTEST_B2G
endif
ifeq ($(MOZ_BUILD_APP),b2g)
DEFINES += -DBOOTSTRAP
DEFINES += -DREFTEST_B2G
endif
# Used in install.rdf
USE_EXTENSION_MANIFEST=1
else
EXTRA_COMPONENTS += reftest-cmdline.manifest
endif
_DEST_DIR = $(DEPTH)/_tests/reftest
@ -62,23 +46,15 @@ include $(topsrcdir)/config/rules.mk
TARGET_DEPTH = ../..
include $(topsrcdir)/build/automation-build.mk
# We want to get an extension-packaged version of reftest as well,
# so this seems to be the simplest way to make that happen.
ifndef XPI_NAME
make-xpi:
+$(MAKE) -C $(DEPTH)/netwerk/test/httpserver misc libs XPI_NAME=reftest
+$(MAKE) misc libs XPI_NAME=reftest
copy-harness: make-xpi
libs:: copy-harness
endif
$(_DEST_DIR):
$(NSINSTALL) -D $@
$(_HARNESS_FILES): $(_DEST_DIR)
# copy harness and the reftest extension bits to $(_DEST_DIR)
copy-harness: $(_HARNESS_FILES) $(addprefix $(_DEST_DIR)/,$(_HARNESS_PP_FILES))
# This needs to happen after jar.mn handling from rules.mk included above.
# The order of the :: rules ensures that.
libs:: $(_HARNESS_FILES) $(addprefix $(_DEST_DIR)/,$(_HARNESS_PP_FILES))
$(INSTALL) $(_HARNESS_FILES) $(_DEST_DIR)
(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - reftest) | (cd $(_DEST_DIR) && tar -xf -)

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

@ -1,14 +1,10 @@
reftest.jar:
% content reftest %content/
* content/reftest-content.js (reftest-content.js)
content/httpd.jsm (../../../netwerk/test/httpserver/httpd.js)
#ifdef BOOTSTRAP
* content/reftest.jsm (reftest.js)
#else
* content/reftest.js (reftest.js)
content/reftest.xul (reftest.xul)
#ifdef XPI_NAME
% component {32530271-8c1b-4b7d-a812-218e42c6bb23} components/reftest-cmdline.js
% contract @mozilla.org/commandlinehandler/general-startup;1?type=reftest {32530271-8c1b-4b7d-a812-218e42c6bb23}
% category command-line-handler m-reftest @mozilla.org/commandlinehandler/general-startup;1?type=reftest
#endif
#endif

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

@ -4,8 +4,16 @@
# 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/.
EXTRA_PP_COMPONENTS += [
if CONFIG['MOZ_BUILD_APP'] in ('b2g', 'b2g/dev', 'mobile/android'):
DEFINES['BOOTSTRAP'] = True
if CONFIG['MOZ_BUILD_APP'] in ('b2g', 'b2g/dev'):
DEFINES['REFTEST_B2G'] = True
else:
EXTRA_PP_COMPONENTS += [
'reftest-cmdline.js',
]
'reftest-cmdline.manifest',
]
JAR_MANIFESTS += ['jar.mn']
XPI_NAME = 'reftest'

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

@ -37,6 +37,7 @@ const NS_OBSERVER_SERVICE_CONTRACTID =
"@mozilla.org/observer-service;1";
Components.utils.import("resource://gre/modules/FileUtils.jsm");
Components.utils.import("chrome://reftest/content/httpd.jsm", this);
var gLoadTimeout = 0;
var gTimeoutHook = null;
@ -397,17 +398,7 @@ function InitAndStartRefTests()
if (gRemote) {
gServer = null;
} else {
// not all gecko applications autoregister xpcom components
if (CC["@mozilla.org/server/jshttp;1"] === undefined) {
var file = CC["@mozilla.org/file/directory_service;1"].
getService(CI.nsIProperties).get("ProfD", CI.nsIFile);
file.appendRelativePath("extensions/reftest@mozilla.org/chrome.manifest");
registrar = Components.manager.QueryInterface(CI.nsIComponentRegistrar);
registrar.autoRegister(file);
}
gServer = CC["@mozilla.org/server/jshttp;1"].
createInstance(CI.nsIHttpServer);
gServer = new HttpServer();
}
try {
if (gServer)

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

@ -5,12 +5,3 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
NO_INTERFACES_MANIFEST = 1
ifdef XPI_NAME
NO_JS_MANIFEST = 1
USE_EXTENSION_MANIFEST = 1
else
EXTRA_COMPONENTS += \
httpd.manifest \
$(NULL)
endif

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

@ -1,6 +0,0 @@
#ifdef XPI_NAME
httpd.jar:
% component {54ef6f81-30af-4b1d-ac55-8ba811293e41} components/httpd.js
% contract @mozilla.org/server/jshttp;1 {54ef6f81-30af-4b1d-ac55-8ba811293e41}
% interfaces components/test_necko.xpt
#endif

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

@ -14,10 +14,9 @@ XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell.ini']
EXTRA_COMPONENTS += [
'httpd.js',
'httpd.manifest',
]
TESTING_JS_MODULES += [
'httpd.js',
]
JAR_MANIFESTS += ['jar.mn']

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

@ -59,7 +59,7 @@ config = {
"--remote-webserver=%(remote_webserver)s", "--xre-path=%(xre_path)s",
"--utility-path=%(utility_path)s", "--deviceIP=%(device_ip)s",
"--devicePort=%(device_port)s", "--http-port=%(http_port)s",
"--ssl-port=%(ssl_port)s", "--httpd-path", "reftest/components",
"--ssl-port=%(ssl_port)s", "--httpd-path", "%(modules_dir)s",
"--symbols-path=%(symbols_path)s",
# Bug 1064002 - Land once mozharness changes land
#"--total-chunks=16",
@ -75,7 +75,7 @@ config = {
"--remote-webserver=%(remote_webserver)s", "--xre-path=%(xre_path)s",
"--utility-path=%(utility_path)s", "--deviceIP=%(device_ip)s",
"--devicePort=%(device_port)s", "--http-port=%(http_port)s",
"--ssl-port=%(ssl_port)s", "--httpd-path", "reftest/components",
"--ssl-port=%(ssl_port)s", "--httpd-path", "%(modules_dir)s",
"--symbols-path=%(symbols_path)s",
"--total-chunks=2",
"tests/testing/crashtest/crashtests.list",
@ -90,7 +90,7 @@ config = {
"--remote-webserver=%(remote_webserver)s", "--xre-path=%(xre_path)s",
"--utility-path=%(utility_path)s", "--deviceIP=%(device_ip)s",
"--devicePort=%(device_port)s", "--http-port=%(http_port)s",
"--ssl-port=%(ssl_port)s", "--httpd-path", "reftest/components",
"--ssl-port=%(ssl_port)s", "--httpd-path", "%(modules_dir)s",
"--symbols-path=%(symbols_path)s",
"../jsreftest/tests/jstests.list",
"--total-chunks=6",

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

@ -22,7 +22,7 @@ config = {
"--remote-webserver=%(remote_webserver)s", "--xre-path=%(xre_path)s",
"--utility-path=%(utility_path)s", "--deviceIP=%(device_ip)s",
"--devicePort=%(device_port)s", "--http-port=%(http_port)s",
"--ssl-port=%(ssl_port)s", "--httpd-path", "reftest/components",
"--ssl-port=%(ssl_port)s", "--httpd-path", "%(modules_dir)s",
"--symbols-path=%(symbols_path)s",
],
},

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

@ -195,13 +195,13 @@ RUN_REFTEST = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftest.py \
REMOTE_REFTEST = rm -f ./$@.log && $(PYTHON) _tests/reftest/remotereftest.py \
--dm_trans=$(DM_TRANS) --ignore-window-size \
--app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
--httpd-path=_tests/reftest/reftest/components \
--httpd-path=_tests/modules \
$(SYMBOLS_PATH) $(EXTRA_TEST_ARGS) '$(1)' | tee ./$@.log
RUN_REFTEST_B2G = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftestb2g.py \
--remote-webserver=10.0.2.2 --b2gpath=${B2G_PATH} --adbpath=${ADB_PATH} \
--xre-path=${MOZ_HOST_BIN} $(SYMBOLS_PATH) --ignore-window-size \
--httpd-path=_tests/reftest/reftest/components \
--httpd-path=_tests/modules \
$(EXTRA_TEST_ARGS) '$(1)' | tee ./$@.log
ifeq ($(OS_ARCH),WINNT) #{