Open Bug 1949533 Opened 4 days ago Updated 4 days ago

Add documentation and linting rule to prevent synchronous import of newtab modules within xpcshell tests

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(Not tracked)

People

(Reporter: mconley, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Whiteboard: [hnt-trainhop])

After bug 1948340 lands, all of the newtab xpcshell tests will be lazily importing resources under resource://newtab. This is necessary, because the head.js of that suite of tests installs the New Tab built-in addon, which registers those resources asynchronously.

This isn't immediately obvious. I can imagine a world down the line where somebody adds a new xpcshell test and is completely mystified about why it's throwing an exception, saying that the file cannot be found.

Adding documentation in browser/extensions/newtab/tests/xpcshell will probably help, but if possible, I'd also like to add a specialized linting rule for the tests under browser/extensions/newtab/tests/xpcshell to prevent calling ChromeUtils.importESModule on anything with the resource://newtab base URI.

You need to log in before you can comment on or make changes to this bug.