Bug 1328830 <https://bugzilla.mozilla.org/show_bug.cgi?id=1328830> recently
landed and has added the ability to set prefs directly in a mochitest
manifest. Prefs can be set like this:

[DEFAULT]
prefs =
    browser.newtabpage.introShown=true
    layout.css.servo.enabled=true

[browser_foo.js]
[browser_bar.js]

There are a few limitations:

1. It must be set in the DEFAULT section. If you try to set prefs on an
individual test, it will error out.
2. Mochitest's --run-by-manifest mode must be enabled. This means that it
will work for all of 'plain', 'browser' and 'chrome'. It will not work for
'a11y' or 'jetpack*'.

The reason for these limitations is that we currently restart the browser
between each manifest when --run-by-manifest is enabled. So prefs can only
be set at the manifest level, and only if we restart Firefox beforehand.

I'm not aware of anyone using this feature yet, so if you run into bugs
please let me know!

-Andrew
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to