Bug 929535 - Use wait-for-jsdebugger with mochitests. r=Gijs draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 13 Mar 2017 11:10:04 -0500
changeset 497675 20f91203f7332752b95fda566d0449927e4d943c
parent 497654 7b19a63862252ffb89bfe1ba79724e76e20fb6f4
child 548937 4615756f9c2480cd9a3a6dc47f82b7ec2c4b8b20
push id48952
push userbmo:jryans@gmail.com
push dateMon, 13 Mar 2017 16:36:30 +0000
reviewersGijs
bugs929535
milestone55.0a1
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
testing/mochitest/mochitest_options.py
testing/mochitest/runtests.py
--- 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