Backed out changeset ae4aeeddd795 (bug 1702603) for causing browser-chrome failures in browser_Heartbeat. CLOSED TREE
authorsmolnar <smolnar@mozilla.com>
Thu, 08 Apr 2021 17:26:01 +0300
changeset 575070 d64c1382f146846d7c1a1f399f195e3b9c5010d7
parent 575069 98fbdf08cf7a66f0230c5cf280edaa94d4ea9d63
child 575071 33850682363d02aece9b45d8d9b7fbc415f6f477
child 575164 6376f06358cd02720bddfbf6fcdbf3bfc98d3c79
push id140464
push usersmolnar@mozilla.com
push dateThu, 08 Apr 2021 14:29:33 +0000
treeherderautoland@d64c1382f146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1702603
milestone89.0a1
backs outae4aeeddd795982177415a3c670ac1797f6b839f
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
Backed out changeset ae4aeeddd795 (bug 1702603) for causing browser-chrome failures in browser_Heartbeat. CLOSED TREE
toolkit/content/tests/chrome/test_notificationbox.xhtml
toolkit/content/widgets/notificationbox.js
--- a/toolkit/content/tests/chrome/test_notificationbox.xhtml
+++ b/toolkit/content/tests/chrome/test_notificationbox.xhtml
@@ -2,17 +2,16 @@
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
 <!--
   XUL Widget Test for notificationbox
   -->
 <window title="Notification Box" width="500" height="600"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>  
-  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>  
 
   <vbox id="nb"/>
   <menupopup id="menupopup" onpopupshown="this.hidePopup()" onpopuphidden="checkPopupClosed()">
     <menuitem label="One"/>
   </menupopup>
 
   <!-- test results are displayed in the html:body -->
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
@@ -28,29 +27,16 @@ var testtag_notificationbox_buttons = [
   {
     label: "Button 1",
     accesskey: "u",
     callback: testtag_notificationbox_buttonpressed,
     popup: "menupopup"
   }
 ];
 
-var testtag_notificationbox_buttons_nopopup = [
-  {
-    label: "Button 1 No Popup",
-    accesskey: "u",
-    callback: testtag_notificationbox_button1pressed,
-  },
-  {
-    label: "Button 2 No Popup",
-    accesskey: "u",
-    callback: testtag_notificationbox_button2pressed,
-  }
-];
-
 var testtag_notificationbox_links = [
   {
     label: "Link 1",
     callback: testtag_notificationbox_buttonpressed,
     link: "about:mozilla"
   },
   {
     label: "Button 2",
@@ -70,20 +56,16 @@ var testtag_notificationbox_supportpage 
 ];
 
 function testtag_notificationbox_buttonpressed(notification, button)
 {
   SimpleTest.is(button.localName, "button");
   return false;
 }
 
-let buttonsPressedLog = "";
-function testtag_notificationbox_button1pressed(notification, button) { buttonsPressedLog += "button1"; return true; }
-function testtag_notificationbox_button2pressed(notification, button) { buttonsPressedLog += "button2"; return true; }
-
 function testtag_notificationbox(nb)
 {
   testtag_notificationbox_State(nb, "initial", null, 0);
 
   SimpleTest.is(nb.removeAllNotifications(false), undefined, "initial removeAllNotifications");
   testtag_notificationbox_State(nb, "initial removeAllNotifications", null, 0);
   SimpleTest.is(nb.removeAllNotifications(true), undefined, "initial removeAllNotifications immediate");
   testtag_notificationbox_State(nb, "initial removeAllNotifications immediate", null, 0);
@@ -345,41 +327,16 @@ var tests =
       SimpleTest.is(link.localName, "label", "link is a label");
       SimpleTest.is(link.href, "about:mozilla", "link href is correct");
 
       SimpleTest.is(nb.removeAllNotifications(false), undefined, "removeAllNotifications");
     }
   },
   {
     test(nb, ntf) {
-      // append a new notification
-      ntf = nb.appendNotification("Notification", "note", "happy.png",
-                                  nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons_nopopup);
-      return ntf;
-    },
-    result(nb, ntf) {
-      let buttons = nb.currentNotification.buttonContainer.querySelectorAll("* button");
-
-      buttons[0].focus();
-      synthesizeKey(" ", {});
-      SimpleTest.is(buttonsPressedLog, "button1", "button 1 with keyboard");
-      buttons[1].focus();
-      synthesizeKey(" ", {});
-      SimpleTest.is(buttonsPressedLog, "button1button2", "button 2 with keyboard");
-
-      synthesizeMouseAtCenter(buttons[0], {});
-      SimpleTest.is(buttonsPressedLog, "button1button2button1", "button 1 with mouse");
-      synthesizeMouseAtCenter(buttons[1], {});
-      SimpleTest.is(buttonsPressedLog, "button1button2button1button2", "button 2 with mouse");
-
-      nb.removeAllNotifications(true);
-    }
-  },
-  {
-    test(nb, ntf) {
       ntf = nb.appendNotification("Notification", "note", "happy.png",
                                       nb.PRIORITY_INFO_LOW,
                                       testtag_notificationbox_supportpage,
                                       notification_eventCallback);
       SimpleTest.is(ntf && ntf.localName == NOTIFICATION_LOCAL_NAME, true, "append support page notification");
       return ntf;
     },
     result(nb, ntf) {
--- a/toolkit/content/widgets/notificationbox.js
+++ b/toolkit/content/widgets/notificationbox.js
@@ -582,17 +582,17 @@
         this.messageText = document.createElement("span");
         this.messageText.classList.add("notification-message");
         this.buttonContainer = document.createElement("span");
         this.buttonContainer.classList.add("notification-button-container");
 
         this.messageImage = this.shadowRoot.querySelector(".icon");
 
         messageContent.append(this.messageText, this.buttonContainer);
-        this.shadowRoot.addEventListener("command", this);
+        this.shadowRoot.addEventListener("click", this);
       }
 
       disconnectedCallback() {
         if (this.eventCallback) {
           this.eventCallback("disconnected");
         }
       }