Update low battery tips string
- Screenshot: https://screenshot.googleplex.com/33zJkqsTex8r49W.png Bug: 183689347 Test: make RunSettingsRoboTests Change-Id: I864c555c3e500bf4ae5364db8dd6c86be564b883
This commit is contained in:
committed by
Wesley Wang
parent
cf2dc5107b
commit
6d836d2d51
@@ -67,8 +67,7 @@ public class BatteryTipUtilsTest {
|
||||
mEarlyWarningTip = spy(
|
||||
new EarlyWarningTip(BatteryTip.StateType.NEW, true /* powerSaveModeOn */));
|
||||
mLowBatteryTip = spy(
|
||||
new LowBatteryTip(BatteryTip.StateType.NEW, false /* powerSaveModeOn */,
|
||||
"" /* summary */));
|
||||
new LowBatteryTip(BatteryTip.StateType.NEW, false /* powerSaveModeOn */));
|
||||
mBatteryDefenderTip = spy(new BatteryDefenderTip(BatteryTip.StateType.NEW));
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,7 @@ import org.robolectric.RuntimeEnvironment;
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class LowBatteryTipTest {
|
||||
|
||||
private static final CharSequence SUMMARY = "Only 15 minutes left";
|
||||
private static final CharSequence SUMMARY = "Turn on Battery Saver to extend battery life";
|
||||
|
||||
@Mock
|
||||
private MetricsFeatureProvider mMetricsFeatureProvider;
|
||||
@@ -48,8 +48,7 @@ public class LowBatteryTipTest {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mLowBatteryTip = new LowBatteryTip(BatteryTip.StateType.NEW, false /* powerSaveModeOn */,
|
||||
SUMMARY);
|
||||
mLowBatteryTip = new LowBatteryTip(BatteryTip.StateType.NEW, false /* powerSaveModeOn */);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -64,6 +63,13 @@ public class LowBatteryTipTest {
|
||||
assertThat(parcelTip.getSummary(mContext)).isEqualTo(SUMMARY);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSummary_tipNew_showTitle() {
|
||||
mLowBatteryTip.mState = BatteryTip.StateType.NEW;
|
||||
|
||||
assertThat(mLowBatteryTip.getTitle(mContext)).isEqualTo("Battery level low");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSummary_tipNew_showSummary() {
|
||||
mLowBatteryTip.mState = BatteryTip.StateType.NEW;
|
||||
|
@@ -85,7 +85,7 @@ public class BatteryFixSliceTest {
|
||||
@Test
|
||||
public void refreshBatteryTips_hasImportantTip_shouldReturnTrue() {
|
||||
final List<BatteryTip> tips = new ArrayList<>();
|
||||
tips.add(new LowBatteryTip(BatteryTip.StateType.INVISIBLE, false, ""));
|
||||
tips.add(new LowBatteryTip(BatteryTip.StateType.INVISIBLE, false));
|
||||
tips.add(new EarlyWarningTip(BatteryTip.StateType.NEW, false));
|
||||
ShadowBatteryTipLoader.setBatteryTips(tips);
|
||||
|
||||
@@ -102,7 +102,7 @@ public class BatteryFixSliceTest {
|
||||
.setPackageName("com.android.settings")
|
||||
.setScreenOnTimeMs(10000L)
|
||||
.build());
|
||||
tips.add(new LowBatteryTip(BatteryTip.StateType.INVISIBLE, false, ""));
|
||||
tips.add(new LowBatteryTip(BatteryTip.StateType.INVISIBLE, false));
|
||||
tips.add(new EarlyWarningTip(BatteryTip.StateType.HANDLED, false));
|
||||
tips.add(new HighUsageTip(1000L, appList));
|
||||
ShadowBatteryTipLoader.setBatteryTips(tips);
|
||||
|
Reference in New Issue
Block a user