Closed
Bug 2085960
Opened 1 month ago
Closed 1 month ago
Always wait for load in InfoBar._showWhenLoaded and test it with loading windows
Categories
(Firefox :: Messaging System, task)
Firefox
Messaging System
Tracking
()
RESOLVED
DUPLICATE
of bug 2083975
People
(Reporter: mkaply, Unassigned)
References
Details
InfoBar._showWhenLoaded shows the infobar right away when the window's readyState is complete, and otherwise waits for load. Neither caller reaches the immediate branch with a window that is actually ready:
showNotificationAllWindowsonly calls it whenreadyStateis notcomplete.observecalls it atdomwindowopened, before the browser document has loaded.
Only tests reach that branch with a loaded window. In browser_asrouter_universal_infobar.js:
observe_domwindowopenedpasses the already-loaded top window toobserve().universalInfobar_persists_original_window_closurepasses a fake window whosereadyStateiscomplete.
These tests exercise a state that never happens with real windows, which is how bug 2083975 got past them.
Proposed:
- Drop the immediate branch so
_showWhenLoadedalways waits forload. - Rewrite the two tests to use a loading window, as
observe_domwindowopened_withLoadEventdoes, or a real window fromBrowserTestUtils.openNewBrowserWindow.
| Reporter | ||
Comment 1•1 month ago
|
||
I'm going to dupe this back to the user bug and fix it there instead of as a followup.
You need to log in
before you can comment on or make changes to this bug.
Description
•