Bug 1476561 - Fix autoplay notification icon. r=johannh
authorDale Harvey <dale@arandomurl.com>
Thu, 19 Jul 2018 21:17:44 +0100
changeset 427463 c1a1d1e1cfbf784f26b3ca0e7ca1a4e6e8420459
parent 427462 afcfe1cd7c552fd0fb79405d4755a346358c55e2
child 427464 3f95add38e74fb18e7b12268ba79c2b934349be1
push id34306
push usercsabou@mozilla.com
push dateFri, 20 Jul 2018 21:41:18 +0000
treeherdermozilla-central@d6a5e8aea651 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1476561
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1476561 - Fix autoplay notification icon. r=johannh MozReview-Commit-ID: BZhTOnhgY8n
browser/base/content/test/popupNotifications/browser_popupNotification_2.js
browser/modules/PermissionUI.jsm
--- 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);
   },