Some tests await on BrowserTestUtils.loadURIString, that doesn't wait for load
Categories
(Firefox :: Address Bar, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox119 | --- | fixed |
People
(Reporter: mak, Assigned: mak)
References
Details
Attachments
(3 files)
This is quite confusing, BrowserTestUtils.loadURIString() doesn't wait for load, but the javadoc is unclear about that, and some tests are awaiting on it.
I initially thought to make it wait, and then consumers could optionally use the promise... through awaiting requires to add listeners that potentially may remain at the end of the test, if the test doesn't await for the promise, and that could cause other intermittents.
Different tests have different needs so just awaiting is not good for all of them.
Thus, I'm thinking to rename BrowserTestUtils.loadURIString() to BrowserTestUtils.startLoadingURIString(), that should make a bit clearer it's only starting the load, not awaiting for its completion... plus updating its javadoc.
This is actually causing intermittents, like bug 1775820.
Assignee | ||
Comment 1•8 months ago
|
||
BrowserTestUtils.loadURIString() is not async, nor returning a promise, it's
effectively not awaiting for the page to be loaded.
Assignee | ||
Comment 2•8 months ago
|
||
BrowserTestUtils.browserLoaded() wants a tabbrowser-tab as input, most of it will
also work passing gBrowser, and indeed some tests ended up doing that.
Unfortunately some parts of it are skipped in that case.
Since it's confusing anyway, let's make it more lenient on its input.
Depends on D188211
Assignee | ||
Comment 3•8 months ago
|
||
This should make a bit clearer that it is only starting the load, not waiting
for its completion.
Depends on D188212
Pushed by mak77@bonardo.net: https://hg.mozilla.org/integration/autoland/rev/34357750f69c Fix tests awaiting on BrowserTestUtils.loadURIString(). r=dao,webdriver-reviewers,devtools-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/edf1527c9a99 BrowserTestUtils.browserLoaded() should also accept gBrowser as input. r=dao https://hg.mozilla.org/integration/autoland/rev/98de7bc404c3 Rename BrowserTestUtils.loadURIString() to .startLoadingURIString(). r=dao
Comment 5•8 months ago
|
||
Backed out for causing remote failures on remote/shared/messagehandler/test/browser/browser_session_data.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/71df25fbac58fb3bd1a743700efb73f291e1712a
Pushed by mak77@bonardo.net: https://hg.mozilla.org/integration/autoland/rev/5f3627b190cf Fix tests awaiting on BrowserTestUtils.loadURIString(). r=dao,webdriver-reviewers,devtools-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/f4052dc7a73a BrowserTestUtils.browserLoaded() should also accept gBrowser as input. r=dao https://hg.mozilla.org/integration/autoland/rev/6b4b7a682e7a Rename BrowserTestUtils.loadURIString() to .startLoadingURIString(). r=dao
Assignee | ||
Updated•8 months ago
|
Comment 7•8 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5f3627b190cf
https://hg.mozilla.org/mozilla-central/rev/f4052dc7a73a
https://hg.mozilla.org/mozilla-central/rev/6b4b7a682e7a
Pushed by smolnar@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/39d188918af5 Fix typo in browser_tab_close_last_tab.js. a=merge
Comment 9•4 months ago
|
||
bugherder |
Description
•