Merge "Fake the cache size to be 0 bytes when cleared." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
375c22d031
@@ -92,4 +92,22 @@ public class AppStorageSizesControllerTest {
|
||||
assertThat(mDataPreference.getSummary()).isEqualTo("100B");
|
||||
assertThat(mTotalPreference.getSummary()).isEqualTo("111B");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fakeCacheFlagSetsCacheToZero() {
|
||||
AppStorageStats result = mock(AppStorageStats.class);
|
||||
when(result.getCodeBytes()).thenReturn(1L);
|
||||
when(result.getCacheBytes()).thenReturn(10L);
|
||||
when(result.getDataBytes()).thenReturn(100L);
|
||||
when(result.getTotalBytes()).thenReturn(111L);
|
||||
|
||||
mController.setResult(result);
|
||||
mController.setCacheCleared(true);
|
||||
mController.updateUi(mContext);
|
||||
|
||||
assertThat(mAppPreference.getSummary()).isEqualTo("1.00B");
|
||||
assertThat(mCachePreference.getSummary()).isEqualTo("0.00B");
|
||||
assertThat(mDataPreference.getSummary()).isEqualTo("100B");
|
||||
assertThat(mTotalPreference.getSummary()).isEqualTo("101B");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user