XUL is no longer enabled by default in Mochitests

29 views
Skip to first unread message

Andrew McCreight

unread,
Aug 19, 2022, 11:44:33 AMAug 19
to Firefox Dev, dev-platform
I recently landed bug 1769791, which stops us from having the allowXULXBL permission by default in Mochitests (excluding Mochitest Chrome). This permission allows XUL in web content, which we do not normally allow. I wanted to remove this behavior by default to make testing closer to the actual web. This was inspired by jmaher's work in bug 1769257 to run tests with a more realistic profile that turned up this XUL issue.

If you still need to test with XUL in web content, there are a few approaches:
* You can use SpecialPowers.pushPermissions() to add an allowXULXBL permission before loading the page that needs it. An example of this is bug 1772851.
* Thanks to jmaher (bug 1773523), you can add "allow_xul_xbl = true" to an .ini manifest to make the test load with the permission. This is useful when it is the initial top-level test page that needs XUL.
* A final, least desirable option is to convert the test to Mochitest Chrome, which still allows XUL files. See bug 1771554.

This permission is still set for reftests. I filed bug 1773580 about looking to remove that. However, I expect that reftests and crashtests aren't testing behavior in exactly the same way, so the use there seems less dangerous, and there are such a large number of XHTML files being used in reftests that it will require a different approach.

Sorry for any inconvenience this causes.

Andrew
Reply all
Reply to author
Forward
0 new messages