Backed out changeset c1d5b019c52c (bug 1369899) for failures in browser_panelUINotifications_multiWindow.js a=backout
authorWes Kocher <wkocher@mozilla.com>
Mon, 05 Jun 2017 15:32:20 -0700
changeset 410541 bec546987332d2217562d0cc7f5340f16af9b451
parent 410540 56b99cb0d9c7f9c0b9a082475fd7d497964aee59
child 410542 e39f4e926692dc1b2c82b1c6cb7d5ac406a90a69
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1369899
milestone55.0a1
backs outc1d5b019c52cef88beafb6168975860fe08a921b
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 c1d5b019c52c (bug 1369899) for failures in browser_panelUINotifications_multiWindow.js a=backout MozReview-Commit-ID: AhqR5TdpXqz
browser/components/customizableui/content/panelUI.js
browser/components/customizableui/test/browser.ini
browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -55,43 +55,17 @@ const PanelUI = {
 
     this.menuButton.addEventListener("mousedown", this);
     this.menuButton.addEventListener("keypress", this);
     this._overlayScrollListenerBoundFn = this._overlayScrollListener.bind(this);
 
     Services.obs.addObserver(this, "fullscreen-nav-toolbox");
     Services.obs.addObserver(this, "appMenu-notifications");
 
-    XPCOMUtils.defineLazyPreferenceGetter(this, "autoHideToolbarInFullScreen",
-      "browser.fullscreen.autohide", false, (pref, previousValue, newValue) => {
-        // On OSX, or with autohide preffed off, MozDOMFullscreen is the only
-        // event we care about, since fullscreen should behave just like non
-        // fullscreen. Otherwise, we don't want to listen to these because
-        // we'd just be spamming ourselves with both of them whenever a user
-        // opened a video.
-        if (newValue) {
-          window.removeEventListener("MozDOMFullscreen:Entered", this);
-          window.removeEventListener("MozDOMFullscreen:Exited", this);
-          window.addEventListener("fullscreen", this);
-        } else {
-          window.addEventListener("MozDOMFullscreen:Entered", this);
-          window.addEventListener("MozDOMFullscreen:Exited", this);
-          window.removeEventListener("fullscreen", this);
-        }
-
-        this._updateNotifications(false);
-      }, autoHidePref => autoHidePref && Services.appinfo.OS !== "Darwin");
-
-    if (this.autoHideToolbarInFullScreen) {
-      window.addEventListener("fullscreen", this);
-    } else {
-      window.addEventListener("MozDOMFullscreen:Entered", this);
-      window.addEventListener("MozDOMFullscreen:Exited", this);
-    }
-
+    window.addEventListener("fullscreen", this);
     window.addEventListener("activate", this);
     window.matchMedia("(-moz-overlay-scrollbars)").addListener(this._overlayScrollListenerBoundFn);
     CustomizableUI.addListener(this);
 
     for (let event of this.kEvents) {
       this.notificationPanel.addEventListener(event, this);
     }
 
@@ -196,18 +170,16 @@ const PanelUI = {
     this._removeEventListeners();
     for (let event of this.kEvents) {
       this.notificationPanel.removeEventListener(event, this);
     }
 
     Services.obs.removeObserver(this, "fullscreen-nav-toolbox");
     Services.obs.removeObserver(this, "appMenu-notifications");
 
-    window.removeEventListener("MozDOMFullscreen:Entered", this);
-    window.removeEventListener("MozDOMFullscreen:Exited", this);
     window.removeEventListener("fullscreen", this);
     window.removeEventListener("activate", this);
     this.menuButton.removeEventListener("mousedown", this);
     this.menuButton.removeEventListener("keypress", this);
     window.matchMedia("(-moz-overlay-scrollbars)").removeListener(this._overlayScrollListenerBoundFn);
     CustomizableUI.removeListener(this);
     this._overlayScrollListenerBoundFn = null;
   },
@@ -349,18 +321,16 @@ const PanelUI = {
         break;
       case "mousedown":
         if (aEvent.button == 0)
           this.toggle(aEvent);
         break;
       case "keypress":
         this.toggle(aEvent);
         break;
-      case "MozDOMFullscreen:Entered":
-      case "MozDOMFullscreen:Exited":
       case "fullscreen":
       case "activate":
         this._updateNotifications();
         break;
     }
   },
 
   get isReady() {
@@ -769,18 +739,20 @@ const PanelUI = {
       // since we don't want their doorhangers competing for attention
       doorhangers.forEach(n => { n.dismissed = true; })
       this._hidePopup();
       this._clearBadge();
       if (!notifications[0].options.badgeOnly) {
         this._showBannerItem(notifications[0]);
       }
     } else if (doorhangers.length > 0) {
+      let autoHideFullScreen = Services.prefs.getBoolPref("browser.fullscreen.autohide", false) &&
+                               Services.appinfo.OS !== "Darwin";
       // Only show the doorhanger if the window is focused and not fullscreen
-      if ((window.fullScreen && this.autoHideToolbarInFullScreen) || Services.focus.activeWindow !== window) {
+      if ((window.fullScreen && autoHideFullScreen) || Services.focus.activeWindow !== window) {
         this._hidePopup();
         this._showBadge(doorhangers[0]);
         this._showBannerItem(doorhangers[0]);
       } else {
         this._clearBadge();
         this._showNotificationPanel(doorhangers[0]);
       }
     } else {
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -151,18 +151,16 @@ skip-if = os == "mac"
 [browser_exit_background_customize_mode.js]
 [browser_overflow_use_subviews.js]
 [browser_panel_keyboard_navigation.js]
 [browser_panel_toggle.js]
 [browser_panelUINotifications.js]
 [browser_panelUINotifications_fullscreen.js]
 tags = fullscreen
 skip-if = os == "mac"
-[browser_panelUINotifications_fullscreen_noAutoHideToolbar.js]
-tags = fullscreen
 [browser_panelUINotifications_multiWindow.js]
 [browser_switch_to_customize_mode.js]
 [browser_synced_tabs_menu.js]
 [browser_check_tooltips_in_navbar.js]
 [browser_editcontrols_update.js]
 subsuite = clipboard
 [browser_photon_customization_context_menus.js]
 [browser_remote_tabs_button.js]
deleted file mode 100644
--- a/browser/components/customizableui/test/browser_panelUINotifications_fullscreen_noAutoHideToolbar.js
+++ /dev/null
@@ -1,51 +0,0 @@
-"use strict";
-
-Cu.import("resource://gre/modules/AppMenuNotifications.jsm");
-
-add_task(async function testFullscreen() {
-  if (Services.appinfo.OS !== "Darwin") {
-    await SpecialPowers.pushPrefEnv({
-      set: [
-        ["browser.fullscreen.autohide", false],
-      ]});
-  }
-
-  is(PanelUI.notificationPanel.state, "closed", "update-manual doorhanger is closed.");
-  let mainActionCalled = false;
-  let mainAction = {
-    callback: () => { mainActionCalled = true; }
-  };
-  AppMenuNotifications.showNotification("update-manual", mainAction);
-
-  isnot(PanelUI.notificationPanel.state, "closed", "update-manual doorhanger is showing.");
-  let notifications = [...PanelUI.notificationPanel.children].filter(n => !n.hidden);
-  is(notifications.length, 1, "PanelUI doorhanger is only displaying one notification.");
-  let doorhanger = notifications[0];
-  is(doorhanger.id, "appMenu-update-manual-notification", "PanelUI is displaying the update-manual notification.");
-
-  EventUtils.synthesizeKey("VK_F11", {});
-  isnot(PanelUI.notificationPanel.state, "closed", "update-manual doorhanger is still showing after entering fullscreen.");
-
-  let popuphiddenPromise = BrowserTestUtils.waitForEvent(PanelUI.notificationPanel, "popuphidden");
-  await ContentTask.spawn(gBrowser.selectedBrowser, {}, async () => {
-    content.document.documentElement.requestFullscreen();
-  });
-  await popuphiddenPromise;
-  await new Promise(executeSoon);
-  is(PanelUI.notificationPanel.state, "closed", "update-manual doorhanger is hidden after entering DOM fullscreen.");
-
-  let popupshownPromise = BrowserTestUtils.waitForEvent(PanelUI.notificationPanel, "popupshown");
-  await ContentTask.spawn(gBrowser.selectedBrowser, {}, async () => {
-    content.document.exitFullscreen();
-  });
-  await popupshownPromise;
-  await new Promise(executeSoon);
-  isnot(PanelUI.notificationPanel.state, "closed", "update-manual doorhanger is shown after exiting DOM fullscreen.");
-  isnot(PanelUI.menuButton.getAttribute("badge-status"), "update-manual", "Badge is not displaying on PanelUI button.");
-
-  let mainActionButton = document.getAnonymousElementByAttribute(doorhanger, "anonid", "button");
-  mainActionButton.click();
-  ok(mainActionCalled, "Main action callback was called");
-  is(PanelUI.notificationPanel.state, "closed", "update-manual doorhanger is closed.");
-  is(PanelUI.menuButton.hasAttribute("badge-status"), false, "Should not have a badge status");
-});