Bug 1100124 - Add --jsdebugger to run marionette under the jsdebugger.;r=ato

This commit is contained in:
Chris Manchester 2014-12-18 12:52:17 -05:00
parent 165479c9ad
commit 4347029bd0
4 changed files with 37 additions and 2 deletions

View File

@ -52,6 +52,15 @@ class GeckoInstance(object):
profile_args["preferences"]["marionette.defaultPrefs.port"] = self.marionette_port
if self.prefs:
profile_args["preferences"].update(self.prefs)
if '-jsdebugger' in self.app_args:
profile_args["preferences"].update({
"devtools.browsertoolbox.panel": "jsdebugger",
"devtools.debugger.remote-enabled": True,
"devtools.debugger.chrome-enabled": True,
"devtools.chrome.enabled": True,
"devtools.debugger.prompt-connection": False,
"marionette.debugging.clicktostart": True,
})
if hasattr(self, "profile_path") and self.profile is None:
if not self.profile_path:

View File

@ -390,7 +390,11 @@ class BaseMarionetteOptions(OptionParser):
action='store',
default='Marionette-based Tests',
help='Define the name to associate with the logger used')
self.add_option('--jsdebugger',
dest='jsdebugger',
action='store_true',
default=False,
help='Enable the jsdebugger for marionette javascript.')
def parse_args(self, args=None, values=None):
options, tests = OptionParser.parse_args(self, args, values)
@ -440,6 +444,9 @@ class BaseMarionetteOptions(OptionParser):
if not 1 <= options.this_chunk <= options.total_chunks:
self.error('Chunk to run must be between 1 and %s.' % options.total_chunks)
if options.jsdebugger:
options.app_args.append('-jsdebugger')
for handler in self.verify_usage_handlers:
handler(options, tests)

View File

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

View File

@ -611,7 +611,24 @@ MarionetteServerConnection.prototype = {
win.addEventListener("load", listener, true);
}
else {
this.startBrowser(win, true);
let clickToStart;
try {
clickToStart = Services.prefs.getBoolPref('marionette.debugging.clicktostart');
Services.prefs.setBoolPref('marionette.debugging.clicktostart', false);
} catch (e) { }
if (clickToStart && (appName != "B2G")) {
let nbox = win.gBrowser.getNotificationBox();
let message = "Starting marionette tests with chrome debugging enabled...";
let buttons = [{
label: "Start execution of marionette tests",
accessKey: 'S',
callback: () => this.startBrowser(win, true)
}];
nbox.appendNotification(message, null, null,
nbox.PRIORITY_WARNING_MEDIUM, buttons);
} else {
this.startBrowser(win, true);
}
}
}