Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java

Issue 1895813004: [Custom Tabs]Unbreak buttons on bottom bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add regression test Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
index b7ee4d5118bdd77796c3878b31e2b8eadcbc0ecf..b74be988fcd0bba5be0d64ad69c267d23b2446d4 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -621,18 +621,23 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
intent.putExtra(CustomTabsIntent.EXTRA_SECONDARY_TOOLBAR_COLOR, barColor);
startCustomTabActivityWithIntent(intent);
- ViewGroup bottomBar = (ViewGroup) getActivity().findViewById(R.id.bottombar);
+ ViewGroup bottomBar = (ViewGroup) getActivity()
+ .findViewById(R.id.custom_tab_bottom_bar_wrapper);
assertNotNull(bottomBar);
+ assertTrue("Bottom Bar wrapper is not visible.", bottomBar.getVisibility() == View.VISIBLE
+ && bottomBar.getHeight() > 0 && bottomBar.getWidth() > 0);
assertEquals("Bottom Bar showing incorrect number of buttons.",
- numItems + 1, bottomBar.getChildCount());
+ numItems, bottomBar.getChildCount());
assertEquals("Bottom bar not showing correct color", barColor,
((ColorDrawable) bottomBar.getBackground()).getColor());
- for (int i = 1; i <= numItems; i++) {
+ for (int i = 0; i < numItems; i++) {
ImageButton button = (ImageButton) bottomBar.getChildAt(i);
assertTrue("Bottom Bar button does not have the correct bitmap.",
expectedIcon.sameAs(((BitmapDrawable) button.getDrawable()).getBitmap()));
+ assertTrue("Bottom Bar button is not visible.", button.getVisibility() == View.VISIBLE
+ && button.getHeight() > 0 && button.getWidth() > 0);
assertEquals("Bottom Bar button does not have correct content description",
- Integer.toString(i), button.getContentDescription());
+ Integer.toString(i + 1), button.getContentDescription());
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabBottomBarDelegate.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698