Bug 1105792 - Avoid assertions in testHomeBanner; r=margaret
authorGeoff Brown <gbrown@mozilla.com>
Fri, 19 Dec 2014 09:22:06 -0700
changeset 220615 eeb02917e3c495172aabc329b6b1f78f8598e6a5
parent 220614 31d8c626581479fd1e7aafe5f5e23c1218b72249
child 220616 b0d0d1cd812adbd556caecee4399cf47170d78a4
push id10503
push userryanvm@gmail.com
push dateFri, 19 Dec 2014 20:13:42 +0000
treeherderfx-team@98ee95ac6be5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1105792
milestone37.0a1
Bug 1105792 - Avoid assertions in testHomeBanner; r=margaret
mobile/android/base/tests/components/AboutHomeComponent.java
--- a/mobile/android/base/tests/components/AboutHomeComponent.java
+++ b/mobile/android/base/tests/components/AboutHomeComponent.java
@@ -63,17 +63,20 @@ public class AboutHomeComponent extends 
         return mSolo.getView(R.id.home_pager_container);
     }
 
     private ViewPager getHomePagerView() {
         return (ViewPager) mSolo.getView(R.id.home_pager);
     }
 
     private View getHomeBannerView() {
-        return mSolo.getView(R.id.home_banner);
+        if (mSolo.waitForView(R.id.home_banner)) {
+            return mSolo.getView(R.id.home_banner);
+        }
+        return null;
     }
 
     public AboutHomeComponent assertCurrentPanel(final PanelType expectedPanel) {
         assertVisible();
 
         final int expectedPanelIndex = getPanelIndexForDevice(expectedPanel);
         fAssertEquals("The current HomePager panel is " + expectedPanel,
                      expectedPanelIndex, getHomePagerView().getCurrentItem());
@@ -93,16 +96,17 @@ public class AboutHomeComponent extends 
                     getHomePagerView().getVisibility() == View.VISIBLE);
         return this;
     }
 
     public AboutHomeComponent assertBannerNotVisible() {
         View banner = getHomeBannerView();
         fAssertTrue("The HomeBanner is not visible",
                     getHomePagerContainer().getVisibility() != View.VISIBLE ||
+                    banner == null ||
                     banner.getVisibility() != View.VISIBLE ||
                     banner.getTranslationY() == banner.getHeight());
         return this;
     }
 
     public AboutHomeComponent assertBannerVisible() {
         fAssertTrue("The HomeBanner is visible",
                     getHomePagerContainer().getVisibility() == View.VISIBLE &&