From 7366d71702cc46a4d9d68080528d641c61a75d33 Mon Sep 17 00:00:00 2001 From: "Wesley.CW Wang" Date: Thu, 1 Apr 2021 22:28:50 +0800 Subject: [PATCH] Fix BatteryInfo test fail - rollback part of ag/14063746 Bug: 183689347 Test: make RunSettingsRoboTests Change-Id: I11129713dac2584c54890f65af53ce76b0672b8d --- .../src/com/android/settings/fuelgauge/BatteryInfoTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java index 8eed2cb3836..afec5cbec3e 100644 --- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java +++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java @@ -150,9 +150,10 @@ public class BatteryInfoTest { mBatteryUsageStats, estimate, SystemClock.elapsedRealtime() * 1000, true /* shortString */); - // Both long and short strings should not have extra text - assertThat(info.remainingLabel.toString()).doesNotContain(ENHANCED_STRING_SUFFIX); + // We only add special mention for the long string + assertThat(info.remainingLabel.toString()).contains(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); }