Backed out changeset 80a2fed814d0 (bug 1132508) for frequent robocop-2 testfailures in testNewTab
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 17 Apr 2015 12:59:34 +0200
changeset 239551 725af2a560d806778b8b1e535bba3e23d1d99f31
parent 239535 51e3cb11a258b9f22dfcdbf89ac99d1c56a1125e
child 239552 3c21c5b430ca4a49b7a681b7be7a94c3413f70fd
child 239555 d0a6539a1ca81e521c25971cb3f95c426d9e3653
child 239600 ade4423fb17de9a31ed359d79079ffd02cbb0b7e
child 239715 68514741896db44e1a4247dc12e669036a0aaa0c
push id12431
push usercbook@mozilla.com
push dateFri, 17 Apr 2015 11:05:42 +0000
treeherderfx-team@3c21c5b430ca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1132508
milestone40.0a1
backs out80a2fed814d0d484ffeb9475fca29ad714cf98c8
Backed out changeset 80a2fed814d0 (bug 1132508) for frequent robocop-2 testfailures in testNewTab
mobile/android/base/tabs/TabsPanel.java
--- a/mobile/android/base/tabs/TabsPanel.java
+++ b/mobile/android/base/tabs/TabsPanel.java
@@ -4,21 +4,21 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.tabs;
 
 import org.mozilla.gecko.AppConstants.Versions;
 import org.mozilla.gecko.GeckoApp;
 import org.mozilla.gecko.GeckoApplication;
 import org.mozilla.gecko.R;
-import org.mozilla.gecko.Tab;
-import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.animation.PropertyAnimator;
+import org.mozilla.gecko.Tab;
+import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.animation.ViewHelper;
 import org.mozilla.gecko.lwt.LightweightTheme;
 import org.mozilla.gecko.lwt.LightweightThemeDrawable;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.widget.GeckoPopupMenu;
 import org.mozilla.gecko.widget.IconTabWidget;
 
 import android.content.Context;
@@ -26,17 +26,16 @@ import android.content.res.Resources;
 import android.graphics.Rect;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewStub;
-import android.view.ViewTreeObserver;
 import android.widget.Button;
 import android.widget.FrameLayout;
 import android.widget.ImageButton;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 
 public class TabsPanel extends LinearLayout
                        implements GeckoPopupMenu.OnMenuItemClickListener,
@@ -373,29 +372,19 @@ public class TabsPanel extends LinearLay
         protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
             super.onLayout(changed, left, top, right, bottom);
             onLightweightThemeChanged();
         }
     }
 
     public void show(Panel panelToShow) {
         prepareToShow(panelToShow);
-
-        final ViewTreeObserver vto = mTabsContainer.getViewTreeObserver();
-        if (vto.isAlive()) {
-            vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
-                @Override
-                public void onGlobalLayout() {
-                    vto.removeGlobalOnLayoutListener(this);
-                    int height = getVerticalPanelHeight();
-                    dispatchLayoutChange(getWidth(), height);
-                    mHeaderVisible = true;
-                }
-            });
-        }
+        int height = getVerticalPanelHeight();
+        dispatchLayoutChange(getWidth(), height);
+        mHeaderVisible = true;
     }
 
     public void prepareToDrag() {
         Tab selectedTab = Tabs.getInstance().getSelectedTab();
         if (selectedTab != null && selectedTab.isPrivate()) {
             prepareToShow(TabsPanel.Panel.PRIVATE_TABS);
         } else {
             prepareToShow(TabsPanel.Panel.NORMAL_TABS);
@@ -466,32 +455,18 @@ public class TabsPanel extends LinearLay
     }
 
     public void refresh() {
         removeAllViews();
 
         inflateLayout(mContext);
         initialize();
 
-        if (mVisible) {
-            final ViewTreeObserver vto = getViewTreeObserver();
-            if (vto.isAlive()) {
-                vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
-                    @Override
-                    public void onGlobalLayout() {
-                        vto.removeGlobalOnLayoutListener(this);
-
-                        // If we've just inflated the tabs panel, only show it once the current
-                        // layout pass is done to avoid displayed temporary UI states during
-                        // relayout.
-                        show(mCurrentPanel);
-                    }
-                });
-            }
-        }
+        if (mVisible)
+            show(mCurrentPanel);
     }
 
     public void autoHidePanel() {
         mActivity.autoHideTabs();
     }
 
     @Override
     public boolean isShown() {