Backed out changeset c7544b24989d (bug 1260595) for perma-oranging browser_1007336_lwthemes_in_customize_mode.js on linux with crashes
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 22 Apr 2016 11:31:58 +0100
changeset 294328 005449bf12df9fa386f1644823961cebd94ed0e7
parent 294327 8a611f83c0e4d62c9971012647f25c60c8e8ff3e
child 294329 0361b7030d363459416d46e651a8c50c9536788f
child 294481 fc15477ce628599519cb0055f52cc195d640dc94
push id18873
push usergijskruitbosch@gmail.com
push dateFri, 22 Apr 2016 10:36:46 +0000
treeherderfx-team@005449bf12df [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1260595
milestone48.0a1
backs outc7544b24989db41199a53b12982e0a696aea3e27
Backed out changeset c7544b24989d (bug 1260595) for perma-oranging browser_1007336_lwthemes_in_customize_mode.js on linux with crashes MozReview-Commit-ID: 2GqsGs7yw9u
browser/components/customizableui/CustomizeMode.jsm
browser/components/customizableui/content/customizeMode.inc.xul
browser/components/customizableui/test/browser_1007336_lwthemes_in_customize_mode.js
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -1336,18 +1336,16 @@ CustomizeMode.prototype = {
     let getMoreURL = Services.urlFormatter.formatURLPref("lightweightThemes.getMoreURL");
     this.window.openUILinkIn(getMoreURL, "tab");
   },
 
   onLWThemesMenuShowing: function(aEvent) {
     const DEFAULT_THEME_ID = "{972ce4c6-7e08-4474-a285-3208198ce6fd}";
     const RECENT_LWT_COUNT = 5;
 
-    this.resetLWThemesMenu(aEvent.target);
-
     function previewTheme(aEvent) {
       LightweightThemeManager.previewTheme(aEvent.target.theme.id != DEFAULT_THEME_ID ?
                                            aEvent.target.theme : null);
     }
 
     function resetPreview() {
       LightweightThemeManager.resetPreview();
     }
@@ -1443,28 +1441,28 @@ CustomizeMode.prototype = {
           element.hidden = true;
           element = element.previousSibling;
         }
       }
       headerLabel.hidden = hideMyThemesSection;
     }.bind(this));
   },
 
-  resetLWThemesMenu: function(target) {
-    let doc = target.ownerDocument;
+  onLWThemesMenuHidden: function(aEvent) {
+    let doc = aEvent.target.ownerDocument;
     let footer = doc.getElementById("customization-lwtheme-menu-footer");
     let recommendedLabel = doc.getElementById("customization-lwtheme-menu-recommended");
     this.swatchForTheme(doc);
     for (let element of [footer, recommendedLabel]) {
       while (element.previousSibling &&
              element.previousSibling.localName == "toolbarbutton") {
         element.previousSibling.remove();
       }
     }
-    target.removeAttribute("height");
+    aEvent.target.removeAttribute("height");
   },
 
   _onUIChange: function() {
     this._changed = true;
     if (!this.resetting) {
       this._updateResetButton();
       this._updateUndoResetButton();
       this._updateEmptyPaletteNotice();
--- a/browser/components/customizableui/content/customizeMode.inc.xul
+++ b/browser/components/customizableui/content/customizeMode.inc.xul
@@ -27,16 +27,17 @@
               oncommand="gCustomizeMode.toggleTitlebar(this.hasAttribute('checked'))"/>
 #endif
       <button id="customization-toolbar-visibility-button" label="&customizeMode.toolbars;" class="customizationmode-button" type="menu">
         <menupopup id="customization-toolbar-menu" onpopupshowing="onViewToolbarsPopupShowing(event)"/>
       </button>
       <button id="customization-lwtheme-button" label="&customizeMode.lwthemes;" class="customizationmode-button" type="menu">
         <panel type="arrow" id="customization-lwtheme-menu"
                onpopupshowing="gCustomizeMode.onLWThemesMenuShowing(event);"
+               onpopuphidden="gCustomizeMode.onLWThemesMenuHidden(event);"
                position="topcenter bottomleft"
                flip="none"
                role="menu">
           <label id="customization-lwtheme-menu-header" value="&customizeMode.lwthemes.myThemes;"/>
           <label id="customization-lwtheme-menu-recommended" value="&customizeMode.lwthemes.recommended;"/>
           <hbox id="customization-lwtheme-menu-footer">
             <toolbarbutton class="customization-lwtheme-menu-footeritem"
                            label="&customizeMode.lwthemes.menuManage;"
--- a/browser/components/customizableui/test/browser_1007336_lwthemes_in_customize_mode.js
+++ b/browser/components/customizableui/test/browser_1007336_lwthemes_in_customize_mode.js
@@ -17,26 +17,16 @@ add_task(function* () {
   let themesButton = document.getElementById("customization-lwtheme-button");
   let popup = document.getElementById("customization-lwtheme-menu");
 
   let popupShownPromise = popupShown(popup);
   EventUtils.synthesizeMouseAtCenter(themesButton, {});
   info("Clicked on themes button");
   yield popupShownPromise;
 
-  // close current tab and re-open Customize menu to confirm correct number of Themes
-  yield endCustomizing();
-  info("Exited customize mode");
-  yield startCustomizing();
-  info("Started customizing a second time");
-  popupShownPromise = popupShown(popup);
-  EventUtils.synthesizeMouseAtCenter(themesButton, {});
-  info("Clicked on themes button a second time");
-  yield popupShownPromise;
-
   let header = document.getElementById("customization-lwtheme-menu-header");
   let recommendedHeader = document.getElementById("customization-lwtheme-menu-recommended");
 
   is(header.nextSibling.nextSibling, recommendedHeader,
      "There should only be one theme (default) in the 'My Themes' section by default");
   is(header.nextSibling.theme.id, DEFAULT_THEME_ID, "That theme should be the default theme");
 
   let firstLWTheme = recommendedHeader.nextSibling;