Fix testing fail for BatteryInfoTest and HighUsageTipTest
- Fix the test fail from ag/14048547 Bug: 183689347 Test: make RunSettingsRoboTests Change-Id: Ia7a0d0fa567b1826a42b304a04e627e3b0e5f896
This commit is contained in:
@@ -63,7 +63,7 @@ import java.util.concurrent.TimeUnit;
|
||||
public class BatteryInfoTest {
|
||||
|
||||
private static final String STATUS_CHARGING_NO_TIME = "50% - charging";
|
||||
private static final String STATUS_CHARGING_TIME = "50% - 0 min until charged";
|
||||
private static final String STATUS_CHARGING_TIME = "50% - 0 min left until full";
|
||||
private static final String STATUS_NOT_CHARGING = "Not charging";
|
||||
private static final long REMAINING_TIME_NULL = -1;
|
||||
private static final long REMAINING_TIME = 2;
|
||||
@@ -72,7 +72,7 @@ public class BatteryInfoTest {
|
||||
private static final String BATTERY_RUN_OUT_PREFIX = "Battery may run out by";
|
||||
private static final long TEST_CHARGE_TIME_REMAINING = TimeUnit.MINUTES.toMicros(1);
|
||||
private static final String TEST_CHARGE_TIME_REMAINING_STRINGIFIED =
|
||||
"1 min left until charged";
|
||||
"1 min left until full";
|
||||
private static final String TEST_BATTERY_LEVEL_10 = "10%";
|
||||
private static final String FIFTEEN_MIN_FORMATTED = "15 min";
|
||||
private static final Estimate MOCK_ESTIMATE = new Estimate(
|
||||
@@ -135,7 +135,7 @@ public class BatteryInfoTest {
|
||||
mBatteryUsageStats, SystemClock.elapsedRealtime() * 1000, true /* shortString */);
|
||||
|
||||
assertThat(info.discharging).isEqualTo(false);
|
||||
assertThat(info.chargeLabel.toString()).isEqualTo("50% - 1 min until charged");
|
||||
assertThat(info.chargeLabel.toString()).isEqualTo("50% - 1 min left until full");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -150,10 +150,9 @@ public class BatteryInfoTest {
|
||||
mBatteryUsageStats, estimate, SystemClock.elapsedRealtime() * 1000,
|
||||
true /* shortString */);
|
||||
|
||||
// We only add special mention for the long string
|
||||
assertThat(info.remainingLabel.toString()).contains(ENHANCED_STRING_SUFFIX);
|
||||
// Both long and short strings should not have extra text
|
||||
assertThat(info.remainingLabel.toString()).doesNotContain(ENHANCED_STRING_SUFFIX);
|
||||
assertThat(info.suggestionLabel).contains(BATTERY_RUN_OUT_PREFIX);
|
||||
// shortened string should not have extra text
|
||||
assertThat(info2.remainingLabel.toString()).doesNotContain(ENHANCED_STRING_SUFFIX);
|
||||
assertThat(info2.suggestionLabel).contains(BATTERY_RUN_OUT_PREFIX);
|
||||
}
|
||||
|
Reference in New Issue
Block a user