Merge "Fix randomly showing anomaly icon"
This commit is contained in:
committed by
Android (Google) Code Review
commit
78a3f9a748
@@ -82,7 +82,7 @@ public class PowerGaugePreferenceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnBindViewHolder_bindAnomalyIcon() {
|
||||
public void testOnBindViewHolder_showAnomaly_bindAnomalyIcon() {
|
||||
mPowerGaugePreference.shouldShowAnomalyIcon(true);
|
||||
mPowerGaugePreference.onBindViewHolder(mPreferenceViewHolder);
|
||||
|
||||
@@ -92,6 +92,17 @@ public class PowerGaugePreferenceTest {
|
||||
assertThat(drawables[0]).isInstanceOf(VectorDrawable.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnBindViewHolder_notShowAnomaly_bindAnomalyIcon() {
|
||||
mPowerGaugePreference.shouldShowAnomalyIcon(false);
|
||||
mPowerGaugePreference.onBindViewHolder(mPreferenceViewHolder);
|
||||
|
||||
final Drawable[] drawables = ((TextView) mPreferenceViewHolder.findViewById(
|
||||
R.id.widget_summary)).getCompoundDrawablesRelative();
|
||||
|
||||
assertThat(drawables[0]).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnBindViewHolder_bindContentDescription() {
|
||||
mPowerGaugePreference.setContentDescription(CONTENT_DESCRIPTION);
|
||||
|
Reference in New Issue
Block a user