Closed Bug 1521707 Opened 8 months ago Closed 8 months ago

Make a UrlbarTestUtils.jsm helper for tests and move functions from head-common.js into it

Categories

(Firefox :: Address Bar, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 66
Tracking Status
firefox66 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxsearch])

Attachments

(3 files)

Following bug 1514164 we have browser/components/urlbar/tests/browser/head-common.js which contains a lot of common urlbar related functions for tests.

If we move them to a .jsm, we can share them across directories better (without having to include the head file). We can also hide some of the implementation in the test functions themselves to make testing simpler and clearer.

I think at the same time, we should make the functions work with both the current address bar and QuantumBar to make it easier to port tests.

For now, the existing functions remain in head-common.js and are wrappers around the UrlbarTestUtils to avoid churn whilst we work out the actual APIs we require.

Depends on D17259

After discussion with Marco today, we decided that I would only go as far as moving the functions into a .jsm. Marco is working on some abstractions to make it easier to work with both the current & QuantumBar.

Try push for the current patches: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7b8a7728aa43abe6cff0ae6623e23e66d8541886

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/60725e26d685
Move waitForDocLoadAndStopIt to BrowserTestUtils. r=mak
https://hg.mozilla.org/integration/autoland/rev/51025d682291
Move promisePopupEvent to BrowserTestUtils.jsm. r=mak
https://hg.mozilla.org/integration/autoland/rev/248f94519729
Move most of urlbar's head-common.js functions to a UrlbarTestUtils.jsm module. r=mak
You need to log in before you can comment on or make changes to this bug.