Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c85b685 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update summary of low battery tip in tests." into rvc-dev am:...

Merge "Update summary of low battery tip in tests." into rvc-dev am: 781ca586 am: 41bb0325 am: d0eacd10

Change-Id: Id1b9f963c5c3b8b041e1464765b6c935cb6313a8
parents 6109f523 d0eacd10
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public class BatteryInfoTest {
    private static final long REMAINING_TIME = 2;
    // Strings are defined in frameworks/base/packages/SettingsLib/res/values/strings.xml
    private static final String ENHANCED_STRING_SUFFIX = "based on your usage";
    private static final String EXTEND_PREFIX = "Extend battery life past";
    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";
@@ -151,10 +151,10 @@ public class BatteryInfoTest {

        // We only add special mention for the long string
        assertThat(info.remainingLabel.toString()).contains(ENHANCED_STRING_SUFFIX);
        assertThat(info.suggestionLabel).contains(EXTEND_PREFIX);
        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(EXTEND_PREFIX);
        assertThat(info2.suggestionLabel).contains(BATTERY_RUN_OUT_PREFIX);
    }

    @Test
@@ -174,7 +174,7 @@ public class BatteryInfoTest {
                mContext.getString(R.string.power_remaining_duration_only_shutdown_imminent));
        assertThat(info2.remainingLabel.toString()).isEqualTo(
                mContext.getString(R.string.power_remaining_duration_only_shutdown_imminent));
        assertThat(info2.suggestionLabel).contains(EXTEND_PREFIX);
        assertThat(info2.suggestionLabel).contains(BATTERY_RUN_OUT_PREFIX);
    }

    @Test
@@ -186,7 +186,7 @@ public class BatteryInfoTest {
                mBatteryStats, estimate, SystemClock.elapsedRealtime() * 1000,
                false /* shortString */);

        assertThat(info.suggestionLabel).doesNotContain(EXTEND_PREFIX);
        assertThat(info.suggestionLabel).doesNotContain(BATTERY_RUN_OUT_PREFIX);
    }

    @Test