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.
Bug 1852963 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
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.