mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1206133 - Fix browser_bug553455.js such that it does not make invalid assumptions about how panels work and refactored from callbacks to Tasks and Promises. r=rhelmer
MozReview-Commit-ID: 79bsQGDVz19 --HG-- extra : rebase_source : ffcbd0e5f35563c3e0c6067c71ce89a2279b225e
This commit is contained in:
parent
2b313fc731
commit
45b3026e70
@ -132,6 +132,7 @@ support-files =
|
||||
!/toolkit/mozapps/extensions/test/xpinstall/restartless-unsigned.xpi
|
||||
!/toolkit/mozapps/extensions/test/xpinstall/restartless.xpi
|
||||
!/toolkit/mozapps/extensions/test/xpinstall/theme.xpi
|
||||
!/toolkit/mozapps/extensions/test/xpinstall/slowinstall.sjs
|
||||
|
||||
[browser_aboutAccounts.js]
|
||||
skip-if = os == "linux" # Bug 958026
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -804,6 +804,7 @@ PopupNotifications.prototype = {
|
||||
});
|
||||
if (!notificationsToShow.length)
|
||||
return;
|
||||
let notificationIds = notificationsToShow.map(n => n.id);
|
||||
|
||||
this._refreshPanel(notificationsToShow);
|
||||
|
||||
@ -811,6 +812,12 @@ PopupNotifications.prototype = {
|
||||
notificationsToShow.forEach(function (n) {
|
||||
this._fireCallback(n, NOTIFICATION_EVENT_SHOWN);
|
||||
}, this);
|
||||
// Let tests know that the panel was updated and what notifications it was
|
||||
// updated with so that tests can wait for the correct notifications to be
|
||||
// added.
|
||||
let event = new this.window.CustomEvent("PanelUpdated",
|
||||
{"detail": notificationIds});
|
||||
this.panel.dispatchEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -869,9 +876,12 @@ PopupNotifications.prototype = {
|
||||
notificationsToShow.forEach(function (n) {
|
||||
this._fireCallback(n, NOTIFICATION_EVENT_SHOWN);
|
||||
}, this);
|
||||
// This notification is used by tests to know when all the processing
|
||||
// These notifications are used by tests to know when all the processing
|
||||
// required to display the panel has happened.
|
||||
this.panel.dispatchEvent(new this.window.CustomEvent("Shown"));
|
||||
let event = new this.window.CustomEvent("PanelUpdated",
|
||||
{"detail": notificationIds});
|
||||
this.panel.dispatchEvent(event);
|
||||
};
|
||||
this._popupshownListener = this._popupshownListener.bind(this);
|
||||
target.addEventListener("popupshown", this._popupshownListener, true);
|
||||
|
Loading…
Reference in New Issue
Block a user