Use NotificationDB directly from parent process
Categories
(Core :: DOM: Notifications, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox142 | --- | fixed |
People
(Reporter: saschanaz, Assigned: saschanaz)
References
Details
Attachments
(5 files)
NotificationStorage is a proxy to NotificationDB for content process, but yet the parent process is still using it through PersistNotification(). This still works because somehow Services.cpmm
works in the parent process too, but there's no need to use it.
Assignee | ||
Comment 1•1 month ago
|
||
Done by ./mach use-moz-src dom/notification/moz.build
.
Also merged the two separate JS module declarations, which was done when it was behind a build flag.
Assignee | ||
Comment 2•1 month ago
|
||
Updated•1 month ago
|
Assignee | ||
Comment 3•1 month ago
|
||
It's more modern way to run async tests.
Mostly just simple textual replacement but there's some more complex replacement where Services.cpmm is used directly, to be able to await instead of managing the test flow in more complex way.
Assignee | ||
Comment 4•1 month ago
|
||
This completely removes Services.cpmm usage from the unit tests.
The diff doesn't look as simple as I hoped, but hopefully not too hard to see the equivalence.
Updated•1 month ago
|
Updated•1 month ago
|
Comment 7•1 month ago
|
||
Backed out for causing bc failures @ browser_openwindow_without_window
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/3efcb41bd3ee453df9a216bf4947b1dc54783861
Assignee | ||
Updated•1 month ago
|
Comment 10•1 month ago
|
||
Backed out for causing bc and wpt failures
Failure log bc browser_handle_notification.js
Failure log wpt simulate-click-handler.sub.https.window.html
Assignee | ||
Comment 11•1 month ago
|
||
Err. So the simulate-click-handler is the real bug that's fixed in the updated patch.
But browser_handle_notification failure is a test bug, in this case simulateNotificationClickWithNewWindow
got faster to open a tab (👍🏻), resulting test behavior change.
// In case the tab is already opened...
let newTab = newWin.gBrowser.tabs.find(
tab => tab.linkedBrowser.currentURI.spec === "https://example.com/"
);
// If not let's wait for one
if (!newTab) {
newTab = await BrowserTestUtils.waitForNewTab(
newWin.gBrowser,
"https://example.com/"
);
}
Here, newWin.gBrowser.tabs
already got the new tab open, but the tab is yet on about:blank
before being navigated to example.com. At that point calling waitForNewTab
is too late and hangs forever. And it's unclear whether I can detect there's already a tab that is navigating to example.com
.
Not sure what to do, perhaps mossop knows?
Comment 12•1 month ago
|
||
(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #11)
Err. So the simulate-click-handler is the real bug that's fixed in the updated patch.
But browser_handle_notification failure is a test bug, in this case
simulateNotificationClickWithNewWindow
got faster to open a tab (👍🏻), resulting test behavior change.// In case the tab is already opened... let newTab = newWin.gBrowser.tabs.find( tab => tab.linkedBrowser.currentURI.spec === "https://example.com/" ); // If not let's wait for one if (!newTab) { newTab = await BrowserTestUtils.waitForNewTab( newWin.gBrowser, "https://example.com/" ); }
Here,
newWin.gBrowser.tabs
already got the new tab open, but the tab is yet onabout:blank
before being navigated to example.com. At that point callingwaitForNewTab
is too late and hangs forever. And it's unclear whether I can detect there's already a tab that is navigating toexample.com
.Not sure what to do, perhaps mossop knows?
There's a few options here I think. Probably the easiest is to use BrowserTestUtils.waitForLocationChange
which will wait for the url you care about to load in any tab, present or future.
Assignee | ||
Comment 13•1 month ago
|
||
Comment 14•1 month ago
|
||
Comment 15•29 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/194aed82c0f6
https://hg.mozilla.org/mozilla-central/rev/aa17185060e2
https://hg.mozilla.org/mozilla-central/rev/72c26fda8554
https://hg.mozilla.org/mozilla-central/rev/dd69c80b15ec
https://hg.mozilla.org/mozilla-central/rev/8701de1509c3
Updated•21 days ago
|
Description
•