Bug 1438763 - fix intermittent orange in undo_notification_multiple_dismissal.js, r?ursula
When
bug 1433324 made these tests run against activity stream, it made the notification
fire from the test's head.js file itself. Unfortunately, that races with the new tab / home
page actually loading, triggering an `onLocationChange` event in the tabbrowser, which
removes the notification again, meaning it is then no longer there when the test expects
it to be.
This wasn't an issue before, because the notification bar was opened via a message from
within the new tab page, which always arrived after the `onLocationChange` event.
Because the current state is temporary anyway, I'm just changing the test to open 2 tabs
first, and then opening the notification bars, which in practice guarantees this happens
after the `onLocationChange` event.
MozReview-Commit-ID: LOzgjrZBp0H
--- a/browser/components/migration/tests/browser/browser_undo_notification_multiple_dismissal.js
+++ b/browser/components/migration/tests/browser/browser_undo_notification_multiple_dismissal.js
@@ -27,18 +27,18 @@ add_task(async function checkNotificatio
});
await OS.File.writeAtomic(path, JSON.stringify(testUndoData), {
encoding: "utf-8",
compression: "lz4",
tmpPath: path + ".tmp",
});
let firstTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home", false);
+ let secondTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home", false);
let firstNotification = await getOrWaitForNotification(firstTab.linkedBrowser, "first tab");
- let secondTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home", false);
let secondNotification = await getOrWaitForNotification(secondTab.linkedBrowser, "second tab");
// Create a listener for the removal in the first tab, and a listener for bookmarks removal,
// then click 'Don't keep' in the second tab, and verify that the notification is removed
// before we start removing bookmarks.
let haveRemovedBookmark = false;
let bmObserver;
let bookmarkRemovedPromise = new Promise(resolve => {