mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1407405 - browser_bug553455.js relies on broken Promise scheduling, r=florian
--HG-- extra : rebase_source : 348b0c0defb8ec8a8a0c6b2ac451ae033c65192f
This commit is contained in:
parent
051f888cef
commit
c696cbeb9e
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user