diff --git a/browser/components/asrouter/tests/browser/browser_asrouter_infobar.js b/browser/components/asrouter/tests/browser/browser_asrouter_infobar.js index b80b3ec7a4b0..a01b2cf14c1f 100644 --- a/browser/components/asrouter/tests/browser/browser_asrouter_infobar.js +++ b/browser/components/asrouter/tests/browser/browser_asrouter_infobar.js @@ -107,7 +107,7 @@ add_task(async function react_to_trigger() { "Notification has default priority" ); // Dismiss the notification - notificationStack.currentNotification.closeButtonEl.click(); + notificationStack.currentNotification.closeButton.click(); }); add_task(async function dismiss_telemetry() { @@ -128,7 +128,7 @@ add_task(async function dismiss_telemetry() { // Remove any IMPRESSION pings dispatchStub.reset(); - infobar.notification.closeButtonEl.click(); + infobar.notification.closeButton.click(); await BrowserTestUtils.waitForCondition( () => infobar.notification === null, @@ -204,7 +204,7 @@ add_task(async function prevent_multiple_messages() { Assert.equal(dispatchStub.callCount, 2, "Impression count did not increase"); // Dismiss the first notification - infobar.notification.closeButtonEl.click(); + infobar.notification.closeButton.click(); Assert.equal(InfoBar._activeInfobar, null, "Cleared the active notification"); // Reset impressions count @@ -218,6 +218,6 @@ add_task(async function prevent_multiple_messages() { Assert.ok(InfoBar._activeInfobar, "activeInfobar is set"); Assert.equal(dispatchStub.callCount, 2, "Called twice with IMPRESSION"); // Dismiss the notification again - infobar.notification.closeButtonEl.click(); + infobar.notification.closeButton.click(); Assert.equal(InfoBar._activeInfobar, null, "Cleared the active notification"); }); diff --git a/browser/modules/test/browser/browser_ProcessHangNotifications.js b/browser/modules/test/browser/browser_ProcessHangNotifications.js index 9150c36d4c5a..963dc2d4b423 100644 --- a/browser/modules/test/browser/browser_ProcessHangNotifications.js +++ b/browser/modules/test/browser/browser_ProcessHangNotifications.js @@ -184,7 +184,7 @@ add_task(async function waitForScriptTest() { }); // Click the "Close" button this time, we shouldn't get a callback at all. - notification.currentNotification.closeButtonEl.click(); + notification.currentNotification.closeButton.click(); // send another hang pulse, we should not get a notification here Services.obs.notifyObservers(hangReport, "process-hang-report"); diff --git a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js index 6300bd17ba37..d105e8374e94 100644 --- a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js +++ b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js @@ -292,7 +292,7 @@ add_task(async function test_other_ignored() { Assert.ok(notification, "There should be a notification"); // Dismiss notification, creating the .dmp.ignore file - notification.closeButtonEl.click(); + notification.closeButton.click(); gNotificationBox.removeNotification(notification, true); await waitForIgnoredReports(toIgnore); @@ -525,7 +525,7 @@ add_task(async function test_can_ignore() { Assert.ok(notification, "There should be a notification"); // Dismiss the notification by clicking on the "X" button. - notification.closeButtonEl.click(); + notification.closeButton.click(); // We'll not wait for the notification to finish its transition - // we'll just remove it right away. gNotificationBox.removeNotification(notification, true); @@ -599,7 +599,7 @@ add_task(async function test_shutdown_while_not_showing() { Assert.ok(notification, "There should be a notification"); // Dismiss the notification by clicking on the "X" button. - notification.closeButtonEl.click(); + notification.closeButton.click(); // We'll not wait for the notification to finish its transition - // we'll just remove it right away. gNotificationBox.removeNotification(notification, true); diff --git a/testing/firefox-ui/tests/functional/safebrowsing/test_notification.py b/testing/firefox-ui/tests/functional/safebrowsing/test_notification.py index d1110fc7d452..c8816a6e0fc4 100644 --- a/testing/firefox-ui/tests/functional/safebrowsing/test_notification.py +++ b/testing/firefox-ui/tests/functional/safebrowsing/test_notification.py @@ -123,7 +123,7 @@ class TestSafeBrowsingNotificationBar(WindowManagerMixin, MarionetteTestCase): message = notification_box.find_element( By.CSS_SELECTOR, "notification-message[value=blocked-badware-page]" ) - button = message.get_property("closeButtonEl") + button = message.get_property("closeButton") button.click() Wait(self.marionette, timeout=self.marionette.timeout.page_load).until( diff --git a/toolkit/content/tests/widgets/test_moz_message_bar.html b/toolkit/content/tests/widgets/test_moz_message_bar.html index 7ee6825ef355..5555ed5847c5 100644 --- a/toolkit/content/tests/widgets/test_moz_message_bar.html +++ b/toolkit/content/tests/widgets/test_moz_message_bar.html @@ -1,23 +1,25 @@ +
+ ++++ + + + + + diff --git a/toolkit/content/widgets/moz-message-bar/moz-message-bar.mjs b/toolkit/content/widgets/moz-message-bar/moz-message-bar.mjs index 8f0c997149ab..d6258602b6a2 100644 --- a/toolkit/content/widgets/moz-message-bar/moz-message-bar.mjs +++ b/toolkit/content/widgets/moz-message-bar/moz-message-bar.mjs @@ -49,10 +49,10 @@ const messageTypeToIconData = { export default class MozMessageBar extends MozLitElement { static queries = { - actionsSlotEl: "slot[name=actions]", + actionsSlot: "slot[name=actions]", actionsEl: ".actions", - closeButtonEl: "moz-button.close", - supportLinkSlotEl: "slot[name=support-link]", + closeButton: "moz-button.close", + supportLinkSlot: "slot[name=support-link]", }; static properties = { @@ -72,7 +72,7 @@ export default class MozMessageBar extends MozLitElement { } onSlotchange() { - let actions = this.actionsSlotEl.assignedNodes(); + let actions = this.actionsSlot.assignedNodes(); this.actionsEl.classList.toggle("active", actions.length); } @@ -87,7 +87,7 @@ export default class MozMessageBar extends MozLitElement { } get supportLinkEls() { - return this.supportLinkSlotEl.assignedElements(); + return this.supportLinkSlot.assignedElements(); } iconTemplate() { diff --git a/toolkit/mozapps/extensions/test/browser/browser_html_discover_view.js b/toolkit/mozapps/extensions/test/browser/browser_html_discover_view.js index 30cb45dc608e..47419ea71884 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_html_discover_view.js +++ b/toolkit/mozapps/extensions/test/browser/browser_html_discover_view.js @@ -657,7 +657,7 @@ add_task(async function checkDiscopaneNotice() { messageBar = win.document.querySelector("moz-message-bar.discopane-notice"); ok(messageBar, "Recommended notice should exist in disco view"); - messageBar.closeButtonEl.click(); + messageBar.closeButton.click(); messageBar = win.document.querySelector("moz-message-bar.discopane-notice"); ok(!messageBar, "Recommended notice should not exist in disco view"); await switchToNonDiscoView(win);