Bug 1476561 - Fix autoplay notification icon. r=johannh
MozReview-Commit-ID: BZhTOnhgY8n
--- a/browser/base/content/test/popupNotifications/browser_popupNotification_2.js
+++ b/browser/base/content/test/popupNotifications/browser_popupNotification_2.js
@@ -178,16 +178,30 @@ var tests = [
let promiseTopic = TestUtils.topicObserved("PopupNotifications-updateNotShowing");
showNotification(notifyObj);
await promiseTopic;
isnot(document.getElementById("geo-notification-icon").boxObject.width, 0,
"geo anchor should be visible");
goNext();
}
},
+ // Test that autoplay media icon is shown
+ { id: "Test#8",
+ async run() {
+ let notifyObj = new BasicNotification(this.id);
+ notifyObj.anchorID = "autoplay-media-notification-icon";
+ notifyObj.addOptions({neverShow: true});
+ let promiseTopic = TestUtils.topicObserved("PopupNotifications-updateNotShowing");
+ showNotification(notifyObj);
+ await promiseTopic;
+ isnot(document.getElementById("autoplay-media-notification-icon").boxObject.width, 0,
+ "autoplay media icon should be visible");
+ goNext();
+ }
+ },
// Test notification close button
{ id: "Test#9",
run() {
this.notifyObj = new BasicNotification(this.id);
this.notification = showNotification(this.notifyObj);
},
onShown(popup) {
checkPopup(popup, this.notifyObj);
--- a/browser/modules/PermissionUI.jsm
+++ b/browser/modules/PermissionUI.jsm
@@ -804,17 +804,17 @@ AutoplayPermissionPrompt.prototype = {
};
},
get notificationID() {
return "autoplay-media";
},
get anchorID() {
- return "autoplay-media-icon";
+ return "autoplay-media-notification-icon";
},
get message() {
if (this.principal.URI.schemeIs("file")) {
return gBrowserBundle.GetStringFromName("autoplay.messageWithFile");
}
return gBrowserBundle.formatStringFromName("autoplay.message", ["<>"], 1);
},