Closed Bug 1759741 Opened 3 years ago Closed 3 years ago

Allow importing devtools/client/shared/test/shared-head.js from xpcshell tests

Categories

(DevTools :: Framework, enhancement)

enhancement

Tracking

(firefox100 fixed)

RESOLVED FIXED
100 Branch
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&regexp=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...

Blocks: 1759822
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6b14b71a829f [devtools] Start using shared-head by a first xpcshell test. r=jdescottes https://hg.mozilla.org/integration/autoland/rev/31b601063d06 [devtools] Remove shared-redux-head being redundant with shared-head.js r=jdescottes
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: