Fix testUidCache_switchLocale_shouldCleanCache in BatteryEntryTest

Remove unused code and test

Bug: 290318160
Fix: 290318160
Test: presubmit
Change-Id: I20c612270c67f55e0b01fa849514ba670b696db3
This commit is contained in:
Zaiyue Xue
2023-07-10 15:05:41 +08:00
parent 5a0d4d1cc3
commit c93fe0b509
2 changed files with 0 additions and 40 deletions

View File

@@ -50,8 +50,6 @@ import org.mockito.junit.MockitoRule;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import java.util.Locale;
@RunWith(RobolectricTestRunner.class)
public class BatteryEntryTest {
@@ -232,17 +230,6 @@ public class BatteryEntryTest {
assertThat(entry.getTimeInBackgroundMs()).isEqualTo(0);
}
@Test
public void testUidCache_switchLocale_shouldCleanCache() {
Locale.setDefault(new Locale("en_US"));
BatteryEntry.sUidCache.put(Integer.toString(APP_UID), null);
assertThat(BatteryEntry.sUidCache).isNotEmpty();
Locale.setDefault(new Locale("zh_TW"));
createBatteryEntryForApp(null, null, HIGH_DRAIN_PACKAGE);
assertThat(BatteryEntry.sUidCache).isEmpty(); // check if cache is clear
}
@Test
public void getKey_UidBatteryConsumer() {
final BatteryEntry entry = createBatteryEntryForApp(null, null, null);