Bug 904812 - "Make resources 'testing-common' and 'testing' available in Mozmill tests" r=Fallen, a=jcranmer
--HG-- extra : commitid : FT5wR9BclwZ extra : rebase_source : d688a14fe48af31075bb292fb14bdfa604e812d0 extra : amend_source : 4fef6765e44c4f514b16c6549ffd164ea7a44219
This commit is contained in:
Родитель
9268a74662
Коммит
8f8cf84ffe
|
@ -38,6 +38,7 @@ PLUGINS_PATH = None
|
||||||
# because we know that we run MozMill only once per process. This needs to be
|
# because we know that we run MozMill only once per process. This needs to be
|
||||||
# fixed if that ever changes.
|
# fixed if that ever changes.
|
||||||
TEST_NAME = None
|
TEST_NAME = None
|
||||||
|
TESTING_MODULES_DIR = None
|
||||||
|
|
||||||
# The name of the (optional) module that tests can define as a wrapper (e.g. to
|
# The name of the (optional) module that tests can define as a wrapper (e.g. to
|
||||||
# run before Thunderbird is started)
|
# run before Thunderbird is started)
|
||||||
|
@ -312,6 +313,8 @@ def monkeypatched_15_run_tests(self, tests, sleeptime=0):
|
||||||
# transfer persisted data
|
# transfer persisted data
|
||||||
frame.persisted = self.persisted
|
frame.persisted = self.persisted
|
||||||
|
|
||||||
|
frame.registerModule("testing-common", TESTING_MODULES_DIR)
|
||||||
|
|
||||||
if len(tests) == 1 and not os.path.isdir(tests[0]):
|
if len(tests) == 1 and not os.path.isdir(tests[0]):
|
||||||
# tests[0] isn't necessarily an abspath'd path, so do that now
|
# tests[0] isn't necessarily an abspath'd path, so do that now
|
||||||
test = os.path.abspath(tests[0])
|
test = os.path.abspath(tests[0])
|
||||||
|
@ -337,9 +340,12 @@ class ThunderTestCLI(mozmill.CLI):
|
||||||
help="The path to the symbol files from build_symbols")
|
help="The path to the symbol files from build_symbols")
|
||||||
parser.add_option('--plugins-path', default=None, dest="plugins",
|
parser.add_option('--plugins-path', default=None, dest="plugins",
|
||||||
help="The path to the plugins directory for the created profile")
|
help="The path to the plugins directory for the created profile")
|
||||||
|
parser.add_option('--testing-modules-dir', default=None,
|
||||||
|
dest="testingmodules",
|
||||||
|
help="The path to the testing modules directory")
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
global SYMBOLS_PATH, PLUGINS_PATH, TEST_NAME
|
global SYMBOLS_PATH, PLUGINS_PATH, TEST_NAME, TESTING_MODULES_DIR
|
||||||
|
|
||||||
# note: we previously hardcoded a JS bridge timeout of 300 seconds,
|
# note: we previously hardcoded a JS bridge timeout of 300 seconds,
|
||||||
# but the default is now 60 seconds...
|
# but the default is now 60 seconds...
|
||||||
|
@ -359,6 +365,7 @@ class ThunderTestCLI(mozmill.CLI):
|
||||||
|
|
||||||
SYMBOLS_PATH = self.options.symbols
|
SYMBOLS_PATH = self.options.symbols
|
||||||
PLUGINS_PATH = self.options.plugins
|
PLUGINS_PATH = self.options.plugins
|
||||||
|
TESTING_MODULES_DIR = self.options.testingmodules
|
||||||
if isinstance(self.options.test, basestring):
|
if isinstance(self.options.test, basestring):
|
||||||
test_paths = [self.options.test]
|
test_paths = [self.options.test]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -42,6 +42,11 @@ class RunTestListOptions(optparse.OptionParser):
|
||||||
action = "store", type = "string", dest = "plugins",
|
action = "store", type = "string", dest = "plugins",
|
||||||
help = "The path to the plugins folder for the test profiles")
|
help = "The path to the plugins folder for the test profiles")
|
||||||
|
|
||||||
|
self.add_option("--testing-modules-dir",
|
||||||
|
action="store", type="string", dest="testingmodules",
|
||||||
|
help="The path to the testing modules directory")
|
||||||
|
defaults["testingmodules"] = ""
|
||||||
|
|
||||||
self.set_defaults(**defaults);
|
self.set_defaults(**defaults);
|
||||||
|
|
||||||
usage = """\
|
usage = """\
|
||||||
|
@ -80,6 +85,10 @@ for directory in f:
|
||||||
args.append("--plugins-path")
|
args.append("--plugins-path")
|
||||||
args.append(options.plugins)
|
args.append(options.plugins)
|
||||||
|
|
||||||
|
if options.testingmodules:
|
||||||
|
args.append("--testing-modules-dir")
|
||||||
|
args.append(os.path.abspath(options.testingmodules))
|
||||||
|
|
||||||
print args
|
print args
|
||||||
outputPipe = subprocess.PIPE
|
outputPipe = subprocess.PIPE
|
||||||
|
|
||||||
|
|
|
@ -718,3 +718,13 @@ var runTestFile = function (filename, invokedFromIDE) {
|
||||||
var getThread = function () {
|
var getThread = function () {
|
||||||
return thread;
|
return thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function registerModule(name, path) {
|
||||||
|
let protocolHandler = Services.io.getProtocolHandler("resource")
|
||||||
|
.QueryInterface(Components.interfaces.nsIResProtocolHandler);
|
||||||
|
|
||||||
|
let modulesFile = Components.classes["@mozilla.org/file/local;1"]
|
||||||
|
.createInstance(Components.interfaces.nsILocalFile);
|
||||||
|
modulesFile.initWithPath(path);
|
||||||
|
protocolHandler.setSubstitution(name, ios.newFileURI(modulesFile));
|
||||||
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ mozmill:
|
||||||
--dir=$(abspath $(topsrcdir))/../mail/test/mozmill \
|
--dir=$(abspath $(topsrcdir))/../mail/test/mozmill \
|
||||||
--symbols-path=$(abspath $(DIST)/crashreporter-symbols) \
|
--symbols-path=$(abspath $(DIST)/crashreporter-symbols) \
|
||||||
--plugins-path=$(abspath $(DIST)/plugins) \
|
--plugins-path=$(abspath $(DIST)/plugins) \
|
||||||
|
--testing-modules-dir=$(abspath $(DEPTH)/_tests/modules) \
|
||||||
$(MOZMILL_EXTRA)
|
$(MOZMILL_EXTRA)
|
||||||
|
|
||||||
mozmill-one: solo-test = $(find-solo-test)
|
mozmill-one: solo-test = $(find-solo-test)
|
||||||
|
@ -44,6 +45,7 @@ mozmill-one:
|
||||||
--binary=$(abspath $(BINARY)) \
|
--binary=$(abspath $(BINARY)) \
|
||||||
--symbols-path=$(abspath $(DIST)/crashreporter-symbols) \
|
--symbols-path=$(abspath $(DIST)/crashreporter-symbols) \
|
||||||
--plugins-path=$(abspath $(DIST)/plugins) \
|
--plugins-path=$(abspath $(DIST)/plugins) \
|
||||||
|
--testing-modules-dir=$(abspath $(DEPTH)/_tests/modules) \
|
||||||
$(MOZMILL_EXTRA)
|
$(MOZMILL_EXTRA)
|
||||||
|
|
||||||
# We need to add the mozmill tests to the package for tests.
|
# We need to add the mozmill tests to the package for tests.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче