<div dir="ltr"><div><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1328830">Bug 1328830</a> recently landed and has added the ability to set prefs directly in a mochitest manifest. Prefs can be set like this:</div><div><br></div><div>[DEFAULT]</div><div>prefs =</div><div>    browser.newtabpage.introShown=true<br></div><div>    layout.css.servo.enabled=true</div><div><br></div><div>[browser_foo.js]</div><div>[browser_bar.js]<br></div><div><br></div><div>There are a few limitations:</div><div><br></div><div>1. It must be set in the DEFAULT section. If you try to set prefs on an individual test, it will error out.</div><div>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*'.</div><div><br></div><div>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.</div><div><br></div><div>I'm not aware of anyone using this feature yet, so if you run into bugs please let me know!</div><div><br></div><div>-Andrew<br></div></div>