Bug 881331 - PopupNotifications added in background windows should show their anchor icon, r=MattN.

This commit is contained in:
Florian Quèze 2013-11-14 08:06:45 +05:30
parent 208115ca6a
commit 2bdb92f14f
2 changed files with 16 additions and 3 deletions

View File

@ -254,5 +254,20 @@ let tests = [
this.notification2.remove();
},
onHidden: function(popup) { }
},
// The anchor icon should be shown for notifications in background windows.
{ id: "Test#13",
run: function() {
let notifyObj = new BasicNotification(this.id);
notifyObj.options.dismissed = true;
let win = gBrowser.replaceTabWithWindow(gBrowser.addTab("about:blank"));
whenDelayedStartupFinished(win, function() {
showNotification(notifyObj);
let anchor = document.getElementById("default-notification-icon");
is(anchor.getAttribute("showing"), "true", "the anchor is shown");
win.close();
goNext();
});
}
}
];

View File

@ -314,9 +314,7 @@ PopupNotifications.prototype = {
if (!notification.dismissed) {
this.window.getAttention();
}
if (notification.anchorElement.parentNode != this.iconBox) {
this._updateAnchorIcon(notifications, notification.anchorElement);
}
this._updateAnchorIcon(notifications, notification.anchorElement);
this._notify("backgroundShow");
}