Update strings when shortString is true

After b/64124535, battery strings in settings page use shortString
version. This cl updates the charging string in this situation to
match the mock.

Note that no matter whether we use shorString, the chargingLabel
should remain the same.

Bug: 64752046
Test: RunSettingsRoboTests
Change-Id: I4395d4660e212688cd560ca0b124acbd9c099cc9
This commit is contained in:
jackqdyulei
2017-08-16 14:34:56 -07:00
parent d0275e53eb
commit ae4b79ee6d
2 changed files with 5 additions and 3 deletions

View File

@@ -123,11 +123,14 @@ public class BatteryInfoTest {
}
@Test
public void testGetBatteryInfo_pluggedIn_dischargingFalse() {
public void testGetBatteryInfo_pluggedInUsingShortString_usesCorrectData() {
doReturn(TEST_CHARGE_TIME_REMAINING).when(mBatteryStats).computeChargeTimeRemaining(
anyLong());
BatteryInfo info = BatteryInfo.getBatteryInfoOld(mContext, mChargingBatteryBroadcast,
mBatteryStats, SystemClock.elapsedRealtime() * 1000, true /* shortString */);
assertThat(info.discharging).isEqualTo(false);
assertThat(info.chargeLabel.toString()).isEqualTo("50% - 1m until fully charged");
}
@Test