Bug 1407405 - browser_bug553455.js relies on broken Promise scheduling, r=florian

--HG--
extra : rebase_source : 348b0c0defb8ec8a8a0c6b2ac451ae033c65192f
This commit is contained in:
Olli Pettay 2017-10-11 14:44:01 +03:00
parent 051f888cef
commit c696cbeb9e

View File

@ -25,6 +25,10 @@ const CHROMEROOT = croot;
var gApp = document.getElementById("bundle_brand").getString("brandShortName");
var gVersion = Services.appinfo.version;
function waitForTick() {
return new Promise(resolve => executeSoon(resolve));
}
function getObserverTopic(aNotificationId) {
let topic = aNotificationId;
if (topic == "xpinstall-disabled")
@ -69,6 +73,7 @@ async function waitForProgressNotification(aPanelOpen = false, aExpectedCount =
await observerPromise;
await panelEventPromise;
await waitForTick();
info("Saw a notification");
ok(PopupNotifications.isPanelOpen, "Panel should be open");
@ -114,6 +119,7 @@ async function waitForNotification(aId, aExpectedCount = 1) {
await observerPromise;
await panelEventPromise;
await waitForTick();
info("Saw a " + aId + " notification");
ok(PopupNotifications.isPanelOpen, "Panel should be open");