Allow importing devtools/client/shared/test/shared-head.js from xpcshell tests
Categories
(DevTools :: Framework, enhancement)
Tracking
(firefox100 fixed)
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
The main test helper file:
https://searchfox.org/mozilla-central/source/devtools/client/shared/test/shared-head.js
is only used by browser mochitest.
While it can't be used as-is from an xpcshell test. Various code throw when doing so as we depend on various symbols/components that only work from the mochitest environment.
This is a bit unfortunate as it prevent easily reuse the exact same test helpers between xpcshell and mochitests.
For example waitForDispatch
is having three copies:
https://searchfox.org/mozilla-central/search?q=function+waitForDispatch%28&path=devtools%2F&case=true®exp=false
We have one copy dedicated to one xpcshell test folder:
devtools/client/memory/test/xpcshell/head.js
Another one dedicated to mochitest:
devtools/client/shared/test/shared-head.js
And this last one used from both:
devtools/client/shared/test/shared-redux-head.js
If xpcshell was able to import shared-head, then we could have only one copy of this method.
There is probably many other functions being duplicated...
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
Comment 4•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6b14b71a829f
https://hg.mozilla.org/mozilla-central/rev/31b601063d06
Description
•