Bug 1541706 - attempt to fix intermittent browser_privatebrowsing.js, r=mixedpuppy

Differential Revision: https://phabricator.services.mozilla.com/D42663

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gijs Kruitbosch 2019-08-20 16:05:26 +00:00
parent dd5a04bc1d
commit e5baa47643
2 changed files with 9 additions and 12 deletions

View File

@ -22,7 +22,6 @@ function check_channel(subject) {
// ----------------------------------------------------------------------------
// Tests we send the right cookies when installing through an InstallTrigger call
let gPrivateWin;
let gPopupShown;
async function test() {
waitForExplicitFinish(); // have to call this ourselves because we're async.
Harness.installConfirmCallback = confirm_install;
@ -57,10 +56,6 @@ async function test() {
gPrivateWin.gBrowser,
TESTROOT + "installtrigger.html?" + triggers
);
gPopupShown = BrowserTestUtils.waitForEvent(
gPrivateWin.PanelUI.notificationPanel,
"popupshown"
);
}
function confirm_install(panel) {
@ -102,16 +97,17 @@ const finish_test = async function(count) {
is(results.return, "true", "installTrigger should have claimed success");
is(results.status, "0", "Callback should have seen a success");
// Explicitly click the "OK" button to avoid the panel reopening in the other window once this
// window closes (see also bug 1535069):
await gPopupShown;
gPrivateWin.PanelUI.notificationPanel
.querySelector("popupnotification[popupid=addon-installed]")
.button.click();
await TestUtils.waitForCondition(() =>
gPrivateWin.AppMenuNotifications._notifications.some(
n => n.id == "addon-installed"
)
);
// Explicitly remove the notification to avoid the panel reopening in the
// other window once this window closes (see also bug 1535069):
gPrivateWin.AppMenuNotifications.removeNotification("addon-installed");
// Now finish the test:
await BrowserTestUtils.closeWindow(gPrivateWin);
Harness.finish(gPrivateWin);
gPrivateWin = null;
gPopupShown = null;
};

View File

@ -179,6 +179,7 @@ var Harness = {
// that which fixes the rest of the tests. Since no test
// here cares about this panel, we just need it to close.
win.PanelUI.notificationPanel.hidePopup();
win.AppMenuNotifications.removeNotification("addon-installed");
delete this._boundWin;
finish();
},