Bug 929535 - Use wait-for-jsdebugger with mochitests. r=Gijs
By using --wait-for-jsdebugger, we can allow the test suite to start
automatically and also ensure the JS debugger has a chance to connect.
There's still an extra click to get the tests running though (at least on macOS)
because the test harness needs to be focused and the extra process used for the
Browser Toolbox removes the focus from it.
MozReview-Commit-ID: 1Eg7lqG3KST
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -724,17 +724,16 @@ class MochitestArguments(ArgumentContain
options.symbolsPath = os.path.join(build_obj.distdir, 'crashreporter-symbols')
if options.jsdebugger:
options.extraPrefs += [
"devtools.debugger.remote-enabled=true",
"devtools.chrome.enabled=true",
"devtools.debugger.prompt-connection=false"
]
- options.autorun = False
if options.debugOnFailure and not options.jsdebugger:
parser.error(
"--debug-on-failure requires --jsdebugger.")
if options.debuggerArgs and not options.debugger:
parser.error(
"--debugger-args requires --debugger.")
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2414,17 +2414,17 @@ toolbar#nav-bar {
try:
self.startServers(options, debuggerInfo)
if options.immersiveMode:
options.browserArgs.extend(('-firefoxpath', options.app))
options.app = self.immersiveHelperPath
if options.jsdebugger:
- options.browserArgs.extend(['-jsdebugger'])
+ options.browserArgs.extend(['-jsdebugger', '-wait-for-jsdebugger'])
# Remove the leak detection file so it can't "leak" to the tests run.
# The file is not there if leak logging was not enabled in the
# application build.
if os.path.exists(self.leak_report_file):
os.remove(self.leak_report_file)
# then again to actually run mochitest