Setting the devtools chrome debugging prefs to true by default in mochitests

Brian Grinstead bgrinstead at mozilla.com
Mon Feb 4 18:59:03 UTC 2019


To follow up here, this change has now landed (Bug 1522921). The change
applies to mochitests and web platform tests. So in these test environments:

1) You can open the Browser Toolbox with the keyboard shortcut
(ctrl+alt+shift+i or cmd+opt+shift+i) during a test, without flipping any
prefs first
2) The input field on the Browser Console is automatically enabled during a
test

I also landed the `--jsconsole` argument to the mochitest command to
automatically open the Browser Console at test startup (Bug 1522916).

Brian

On Fri, Jan 25, 2019 at 10:54 AM Brian Grinstead <bgrinstead at mozilla.com>
wrote:

> This is copied from
> https://bugzilla.mozilla.org/show_bug.cgi?id=1522921#c0, but I’m posting
> it to the list to get feedback in case there’s a reason not to do it that I
> haven’t thought of.
>
> When I run a mochitest without the --jsdebugger arg, I sometimes still
> want to open the Browser Toolbox after the fact.
>
> This requires jumping through hoops, because the following prefs are false
> by default:
>
> https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/testing/mochitest/mochitest_options.py#708-713
> due to
> https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/testing/profiles/perf/user.js#44-45
> .
>
> So I need to manually go through steps to open it:
> https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox#Enabling_the_Browser_Toolbox.
> But I run out of time and the mochitest times out before I get very far.
>
> Some workarounds available:
>
> 1) set up an [alias] in machrc like:
> mochitest = mochitest --setpref devtools.chrome.enabled=true --setpref
> devtools.debugger.remote-enabled=true --setpref
> devtools.debugger.prompt-connection=false
> 2) Always run mochitest with --jsdebugger or with the above --setpref calls
>
> But I’m guessing this might be a common pain point, and suggest we should
> either:
>
> 1) remove the overrides in
> https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/testing/profiles/perf/user.js#44-45.
> We already do this for local builds at
> https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/devtools/shared/preferences/devtools-shared.js#27
> )
> 2) Unconditionally set them to true for mochitest only at
> https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/testing/mochitest/mochitest_options.py#708-713
> .
>
> I’m leaning towards doing (2) since it’s a smaller change, and maybe other
> harnesses have a reason to not flip these.
>
> Thanks,
> Brian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20190204/47b179ea/attachment.html>


More information about the firefox-dev mailing list