Closed Bug 1521707 Opened 2 years ago Closed 2 years ago

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


(Firefox :: Address Bar, enhancement, P1)




Firefox 66
Tracking Status
firefox66 --- fixed


(Reporter: standard8, Assigned: standard8)



(Whiteboard: [fxsearch])


(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:

Pushed by
Move waitForDocLoadAndStopIt to BrowserTestUtils. r=mak
Move promisePopupEvent to BrowserTestUtils.jsm. r=mak
Move most of urlbar's head-common.js functions to a UrlbarTestUtils.jsm module. r=mak
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66
You need to log in before you can comment on or make changes to this bug.