Merge "Set default background color for home icon."
This commit is contained in:
committed by
Android (Google) Code Review
commit
7b35e42f34
@@ -96,6 +96,20 @@ public class AdaptiveHomepageIconTest {
|
||||
assertThat(icon.mBackgroundColor).isEqualTo(0xff0000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setBackgroundColor_tileWithoutBackgroundColor_shouldSetDefaultBackgroundColor() {
|
||||
final Tile tile = spy(new Tile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE));
|
||||
doReturn(Icon.createWithResource(mContext, R.drawable.ic_settings))
|
||||
.when(tile).getIcon(mContext);
|
||||
final AdaptiveHomepageIcon icon =
|
||||
new AdaptiveHomepageIcon(mContext, new ColorDrawable(Color.BLACK));
|
||||
|
||||
icon.setBackgroundColor(mContext, tile);
|
||||
|
||||
assertThat(icon.mBackgroundColor).isEqualTo(
|
||||
mContext.getColor(R.color.homepage_generic_icon_background));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onBindTile_externalTileWithBackgroundColorHint_shouldUpdateIcon() {
|
||||
final Tile tile = spy(new Tile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE));
|
||||
|
Reference in New Issue
Block a user