mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1701173, wait for notificationbars to close more reliably by waiting for the notification node to be removed, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D110000
This commit is contained in:
parent
2d3955cf38
commit
0f2a4484d4
@ -174,22 +174,23 @@ async function testFrameCrash(numTabs) {
|
||||
// Press the ignore button on the visible notification.
|
||||
let notificationBox = gBrowser.getNotificationBox(gBrowser.selectedBrowser);
|
||||
let notification = notificationBox.currentNotification;
|
||||
notification.dismiss();
|
||||
|
||||
// Make sure all of the notifications were closed when one of them was closed.
|
||||
let closedPromises = [];
|
||||
for (let count = 1; count <= numTabs; count++) {
|
||||
let nb = gBrowser.getNotificationBox(gBrowser.browsers[count]);
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() => !nb.currentNotification,
|
||||
"notification closed"
|
||||
);
|
||||
|
||||
ok(
|
||||
!nb.currentNotification,
|
||||
"notification " + count + " closed when dismiss button is pressed"
|
||||
closedPromises.push(
|
||||
BrowserTestUtils.waitForMutationCondition(
|
||||
nb.stack,
|
||||
{ childList: true },
|
||||
() => !nb.currentNotification
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
notification.dismiss();
|
||||
await Promise.all(closedPromises);
|
||||
|
||||
for (let count = 1; count <= numTabs; count++) {
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user