Bug 1120630 - Add --e10s to turn on electrolysis for marionette tests.;r=jgriffin

This commit is contained in:
Chris Manchester 2015-01-13 21:27:25 -05:00
Родитель 5c2408216d
Коммит 7059c5b81b
5 изменённых файлов: 36 добавлений и 4 удалений

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

@ -31,7 +31,7 @@ class GeckoInstance(object):
"browser.tabs.remote.autostart.2": False}
def __init__(self, host, port, bin, profile=None, app_args=None, symbols_path=None,
gecko_log=None, prefs=None, ):
gecko_log=None, prefs=None):
self.marionette_host = host
self.marionette_port = port
self.bin = bin
@ -42,6 +42,9 @@ class GeckoInstance(object):
else:
self.profile_path = profile
self.prefs = prefs
self.required_prefs = deepcopy(GeckoInstance.required_prefs)
if prefs:
self.required_prefs.update(prefs)
self.app_args = app_args or []
self.runner = None
self.symbols_path = symbols_path

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

@ -472,7 +472,7 @@ class Marionette(object):
gecko_log=None, homedir=None, baseurl=None, no_window=False, logdir=None,
busybox=None, symbols_path=None, timeout=None, socket_timeout=360,
device_serial=None, adb_path=None, process_args=None,
adb_host=None, adb_port=None):
adb_host=None, adb_port=None, prefs=None):
self.host = host
self.port = self.local_port = port
self.bin = bin
@ -519,7 +519,7 @@ class Marionette(object):
self.instance = instance_class(host=self.host, port=self.port,
bin=self.bin, profile=self.profile,
app_args=app_args, symbols_path=symbols_path,
gecko_log=gecko_log)
gecko_log=gecko_log, prefs=prefs)
self.instance.start()
assert(self.wait_for_port()), "Timed out waiting for port!"

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

@ -88,6 +88,21 @@ def skip_if_b2g(target):
return wrapper
def skip_if_e10s(target):
def wrapper(self, *args, **kwargs):
with self.marionette.using_context('chrome'):
multi_process_browser = self.marionette.execute_script("""
try {
return Services.appinfo.browserTabsRemoteAutostart;
} catch (e) {
return false;
}""")
if multi_process_browser:
raise SkipTest('skipping due to e10s')
return target(self, *args, **kwargs)
return wrapper
def parameterized(func_suffix, *args, **kwargs):
"""
A decorator that can generate methods given a base method and some data.

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

@ -395,6 +395,11 @@ class BaseMarionetteOptions(OptionParser):
action='store_true',
default=False,
help='Enable the jsdebugger for marionette javascript.')
self.add_option('--e10s',
dest='e10s',
action='store_true',
default=False,
help='Enable e10s when running marionette tests.')
def parse_args(self, args=None, values=None):
options, tests = OptionParser.parse_args(self, args, values)
@ -447,6 +452,11 @@ class BaseMarionetteOptions(OptionParser):
if options.jsdebugger:
options.app_args.append('-jsdebugger')
if options.e10s:
options.prefs = {
'browser.tabs.remote.autostart': True
}
for handler in self.verify_usage_handlers:
handler(options, tests)
@ -466,7 +476,7 @@ class BaseMarionetteTestRunner(object):
shuffle=False, shuffle_seed=random.randint(0, sys.maxint),
sdcard=None, this_chunk=1, total_chunks=1, sources=None,
server_root=None, gecko_log=None, result_callbacks=None,
adb_host=None, adb_port=None, **kwargs):
adb_host=None, adb_port=None, prefs=None, **kwargs):
self.address = address
self.emulator = emulator
self.emulator_binary = emulator_binary
@ -508,6 +518,7 @@ class BaseMarionetteTestRunner(object):
self.result_callbacks = result_callbacks if result_callbacks is not None else []
self._adb_host = adb_host
self._adb_port = adb_port
self.prefs = prefs
def gather_debug(test, status):
rv = {}
@ -620,6 +631,7 @@ class BaseMarionetteTestRunner(object):
'timeout': self.timeout,
'adb_host': self._adb_host,
'adb_port': self._adb_port,
'prefs': self.prefs,
}
if self.bin:
kwargs.update({

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

@ -132,6 +132,8 @@ class MachCommands(MachCommandBase):
help='Path to gecko log file, or "-" for stdout.')
@CommandArgument('--jsdebugger', action='store_true',
help='Enable the jsdebugger for marionette javascript.')
@CommandArgument('--e10s', action='store_true',
help='Enable electrolysis for marionette tests (desktop only).')
@CommandArgument('tests', nargs='*', metavar='TESTS',
help='Path to test(s) to run.')
def run_marionette_test(self, tests, **kwargs):