Merge "Query storage size instead of calculate size of installed APP" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0eaf329a43
@@ -77,14 +77,14 @@ public class StorageDashboardFragmentTest {
|
||||
CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
|
||||
PrivateStorageInfo info = new PrivateStorageInfo(0, 0);
|
||||
when(helper.getCachedPrivateStorageInfo()).thenReturn(info);
|
||||
SparseArray<StorageAsyncLoader.AppsStorageResult> result = new SparseArray<>();
|
||||
when(helper.getCachedAppsStorageResult()).thenReturn(result);
|
||||
SparseArray<StorageAsyncLoader.StorageResult> result = new SparseArray<>();
|
||||
when(helper.getCachedStorageResult()).thenReturn(result);
|
||||
|
||||
mFragment.setCachedStorageValuesHelper(helper);
|
||||
mFragment.initializeCachedValues();
|
||||
|
||||
assertThat(mFragment.getPrivateStorageInfo()).isEqualTo(info);
|
||||
assertThat(mFragment.getAppsStorageResult()).isEqualTo(result);
|
||||
assertThat(mFragment.getStorageResult()).isEqualTo(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -97,20 +97,20 @@ public class StorageDashboardFragmentTest {
|
||||
mFragment.initializeCachedValues();
|
||||
|
||||
assertThat(mFragment.getPrivateStorageInfo()).isNull();
|
||||
assertThat(mFragment.getAppsStorageResult()).isNull();
|
||||
assertThat(mFragment.getStorageResult()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing() {
|
||||
CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
|
||||
SparseArray<StorageAsyncLoader.AppsStorageResult> result = new SparseArray<>();
|
||||
when(helper.getCachedAppsStorageResult()).thenReturn(result);
|
||||
SparseArray<StorageAsyncLoader.StorageResult> result = new SparseArray<>();
|
||||
when(helper.getCachedStorageResult()).thenReturn(result);
|
||||
|
||||
mFragment.setCachedStorageValuesHelper(helper);
|
||||
mFragment.initializeCachedValues();
|
||||
|
||||
assertThat(mFragment.getPrivateStorageInfo()).isNull();
|
||||
assertThat(mFragment.getAppsStorageResult()).isNull();
|
||||
assertThat(mFragment.getStorageResult()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -169,7 +169,7 @@ public class StorageDashboardFragmentTest {
|
||||
mFragment = spy(mFragment);
|
||||
when(mFragment.getView()).thenReturn(fakeView);
|
||||
when(mFragment.getListView()).thenReturn(fakeRecyclerView);
|
||||
mFragment.setAppsStorageResult(new SparseArray<>());
|
||||
mFragment.setStorageResult(new SparseArray<>());
|
||||
|
||||
mFragment.maybeSetLoading(true);
|
||||
|
||||
@@ -185,7 +185,7 @@ public class StorageDashboardFragmentTest {
|
||||
when(mFragment.getView()).thenReturn(fakeView);
|
||||
when(mFragment.getListView()).thenReturn(fakeRecyclerView);
|
||||
|
||||
mFragment.setAppsStorageResult(new SparseArray<>());
|
||||
mFragment.setStorageResult(new SparseArray<>());
|
||||
PrivateStorageInfo storageInfo = new PrivateStorageInfo(0, 0);
|
||||
mFragment.setPrivateStorageInfo(storageInfo);
|
||||
|
||||
@@ -203,4 +203,4 @@ public class StorageDashboardFragmentTest {
|
||||
assertThat(indexRes).isNotNull();
|
||||
assertThat(indexRes.get(0).xmlResId).isEqualTo(mFragment.getPreferenceScreenResId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ public class StorageItemPreferenceTest {
|
||||
@Test
|
||||
public void testAfterLoad() {
|
||||
mPreference.setStorageSize(MEGABYTE_IN_BYTES * 10, MEGABYTE_IN_BYTES * 100);
|
||||
assertThat(mPreference.getSummary()).isEqualTo("0.01 GB");
|
||||
assertThat(mPreference.getSummary()).isEqualTo("10 MB");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -16,7 +16,9 @@
|
||||
|
||||
package com.android.settings.deviceinfo.storage;
|
||||
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.AUDIO_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.CACHE_APPS_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.DOCUMENTS_AND_OTHER_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.EXTERNAL_APP_BYTES;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper
|
||||
.EXTERNAL_AUDIO_BYTES;
|
||||
@@ -28,15 +30,15 @@ import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper
|
||||
.EXTERNAL_VIDEO_BYTES;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.FREE_BYTES_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.GAME_APPS_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.MUSIC_APPS_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.IMAGES_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.OTHER_APPS_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.PHOTO_APPS_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper
|
||||
.SHARED_PREFERENCES_NAME;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.TIMESTAMP_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.TOTAL_BYTES_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.TRASH_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.USER_ID_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.VIDEO_APPS_SIZE_KEY;
|
||||
import static com.android.settings.deviceinfo.storage.CachedStorageValuesHelper.VIDEOS_SIZE_KEY;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
@@ -81,9 +83,9 @@ public class CachedStorageValuesHelperTest {
|
||||
mSharedPreferences
|
||||
.edit()
|
||||
.putLong(GAME_APPS_SIZE_KEY, 0)
|
||||
.putLong(MUSIC_APPS_SIZE_KEY, 10)
|
||||
.putLong(VIDEO_APPS_SIZE_KEY, 100)
|
||||
.putLong(PHOTO_APPS_SIZE_KEY, 1000)
|
||||
.putLong(AUDIO_SIZE_KEY, 10)
|
||||
.putLong(VIDEOS_SIZE_KEY, 100)
|
||||
.putLong(IMAGES_SIZE_KEY, 1000)
|
||||
.putLong(OTHER_APPS_SIZE_KEY, 10000)
|
||||
.putLong(CACHE_APPS_SIZE_KEY, 100000)
|
||||
.putLong(EXTERNAL_TOTAL_BYTES, 2)
|
||||
@@ -104,14 +106,16 @@ public class CachedStorageValuesHelperTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getCachedAppsStorageResult_cachedValuesAreLoaded() {
|
||||
public void getCachedStorageResult_cachedValuesAreLoaded() {
|
||||
when(mMockClock.getCurrentTime()).thenReturn(10001L);
|
||||
mSharedPreferences
|
||||
.edit()
|
||||
.putLong(GAME_APPS_SIZE_KEY, 1)
|
||||
.putLong(MUSIC_APPS_SIZE_KEY, 10)
|
||||
.putLong(VIDEO_APPS_SIZE_KEY, 100)
|
||||
.putLong(PHOTO_APPS_SIZE_KEY, 1000)
|
||||
.putLong(AUDIO_SIZE_KEY, 10)
|
||||
.putLong(VIDEOS_SIZE_KEY, 100)
|
||||
.putLong(IMAGES_SIZE_KEY, 1000)
|
||||
.putLong(DOCUMENTS_AND_OTHER_SIZE_KEY, 1001)
|
||||
.putLong(TRASH_SIZE_KEY, 1002)
|
||||
.putLong(OTHER_APPS_SIZE_KEY, 10000)
|
||||
.putLong(CACHE_APPS_SIZE_KEY, 100000)
|
||||
.putLong(EXTERNAL_TOTAL_BYTES, 222222)
|
||||
@@ -125,15 +129,17 @@ public class CachedStorageValuesHelperTest {
|
||||
.putLong(TIMESTAMP_KEY, 10000L)
|
||||
.apply();
|
||||
|
||||
final SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
||||
mCachedValuesHelper.getCachedAppsStorageResult();
|
||||
final SparseArray<StorageAsyncLoader.StorageResult> result =
|
||||
mCachedValuesHelper.getCachedStorageResult();
|
||||
|
||||
StorageAsyncLoader.AppsStorageResult primaryResult = result.get(0);
|
||||
StorageAsyncLoader.StorageResult primaryResult = result.get(0);
|
||||
assertThat(primaryResult.gamesSize).isEqualTo(1L);
|
||||
assertThat(primaryResult.musicAppsSize).isEqualTo(10L);
|
||||
assertThat(primaryResult.videoAppsSize).isEqualTo(100L);
|
||||
assertThat(primaryResult.photosAppsSize).isEqualTo(1000L);
|
||||
assertThat(primaryResult.otherAppsSize).isEqualTo(10000L);
|
||||
assertThat(primaryResult.audioSize).isEqualTo(10L);
|
||||
assertThat(primaryResult.videosSize).isEqualTo(100L);
|
||||
assertThat(primaryResult.imagesSize).isEqualTo(1000L);
|
||||
assertThat(primaryResult.documentsAndOtherSize).isEqualTo(1001L);
|
||||
assertThat(primaryResult.trashSize).isEqualTo(1002L);
|
||||
assertThat(primaryResult.allAppsExceptGamesSize).isEqualTo(10000L);
|
||||
assertThat(primaryResult.cacheSize).isEqualTo(100000L);
|
||||
assertThat(primaryResult.externalStats.totalBytes).isEqualTo(222222L);
|
||||
assertThat(primaryResult.externalStats.audioBytes).isEqualTo(22L);
|
||||
@@ -148,9 +154,9 @@ public class CachedStorageValuesHelperTest {
|
||||
mSharedPreferences
|
||||
.edit()
|
||||
.putLong(GAME_APPS_SIZE_KEY, 0)
|
||||
.putLong(MUSIC_APPS_SIZE_KEY, 10)
|
||||
.putLong(VIDEO_APPS_SIZE_KEY, 100)
|
||||
.putLong(PHOTO_APPS_SIZE_KEY, 1000)
|
||||
.putLong(AUDIO_SIZE_KEY, 10)
|
||||
.putLong(VIDEOS_SIZE_KEY, 100)
|
||||
.putLong(IMAGES_SIZE_KEY, 1000)
|
||||
.putLong(OTHER_APPS_SIZE_KEY, 10000)
|
||||
.putLong(CACHE_APPS_SIZE_KEY, 100000)
|
||||
.putLong(EXTERNAL_TOTAL_BYTES, 2)
|
||||
@@ -169,14 +175,14 @@ public class CachedStorageValuesHelperTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getCachedAppsStorageResult_nullIfDataIsStale() {
|
||||
public void getCachedStorageResult_nullIfDataIsStale() {
|
||||
when(mMockClock.getCurrentTime()).thenReturn(10000000L);
|
||||
mSharedPreferences
|
||||
.edit()
|
||||
.putLong(GAME_APPS_SIZE_KEY, 0)
|
||||
.putLong(MUSIC_APPS_SIZE_KEY, 10)
|
||||
.putLong(VIDEO_APPS_SIZE_KEY, 100)
|
||||
.putLong(PHOTO_APPS_SIZE_KEY, 1000)
|
||||
.putLong(AUDIO_SIZE_KEY, 10)
|
||||
.putLong(VIDEOS_SIZE_KEY, 100)
|
||||
.putLong(IMAGES_SIZE_KEY, 1000)
|
||||
.putLong(OTHER_APPS_SIZE_KEY, 10000)
|
||||
.putLong(CACHE_APPS_SIZE_KEY, 100000)
|
||||
.putLong(EXTERNAL_TOTAL_BYTES, 2)
|
||||
@@ -190,8 +196,8 @@ public class CachedStorageValuesHelperTest {
|
||||
.putLong(TIMESTAMP_KEY, 10000L)
|
||||
.apply();
|
||||
|
||||
final SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
||||
mCachedValuesHelper.getCachedAppsStorageResult();
|
||||
final SparseArray<StorageAsyncLoader.StorageResult> result =
|
||||
mCachedValuesHelper.getCachedStorageResult();
|
||||
assertThat(result).isNull();
|
||||
}
|
||||
|
||||
@@ -201,9 +207,9 @@ public class CachedStorageValuesHelperTest {
|
||||
mSharedPreferences
|
||||
.edit()
|
||||
.putLong(GAME_APPS_SIZE_KEY, 0)
|
||||
.putLong(MUSIC_APPS_SIZE_KEY, 10)
|
||||
.putLong(VIDEO_APPS_SIZE_KEY, 100)
|
||||
.putLong(PHOTO_APPS_SIZE_KEY, 1000)
|
||||
.putLong(AUDIO_SIZE_KEY, 10)
|
||||
.putLong(VIDEOS_SIZE_KEY, 100)
|
||||
.putLong(IMAGES_SIZE_KEY, 1000)
|
||||
.putLong(OTHER_APPS_SIZE_KEY, 10000)
|
||||
.putLong(CACHE_APPS_SIZE_KEY, 100000)
|
||||
.putLong(EXTERNAL_TOTAL_BYTES, 2)
|
||||
@@ -222,14 +228,14 @@ public class CachedStorageValuesHelperTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getCachedAppsStorageResult_nullIfWrongUser() {
|
||||
public void getCachedStorageResult_nullIfWrongUser() {
|
||||
when(mMockClock.getCurrentTime()).thenReturn(10001L);
|
||||
mSharedPreferences
|
||||
.edit()
|
||||
.putLong(GAME_APPS_SIZE_KEY, 0)
|
||||
.putLong(MUSIC_APPS_SIZE_KEY, 10)
|
||||
.putLong(VIDEO_APPS_SIZE_KEY, 100)
|
||||
.putLong(PHOTO_APPS_SIZE_KEY, 1000)
|
||||
.putLong(AUDIO_SIZE_KEY, 10)
|
||||
.putLong(VIDEOS_SIZE_KEY, 100)
|
||||
.putLong(IMAGES_SIZE_KEY, 1000)
|
||||
.putLong(OTHER_APPS_SIZE_KEY, 10000)
|
||||
.putLong(CACHE_APPS_SIZE_KEY, 100000)
|
||||
.putLong(EXTERNAL_TOTAL_BYTES, 2)
|
||||
@@ -243,8 +249,8 @@ public class CachedStorageValuesHelperTest {
|
||||
.putLong(TIMESTAMP_KEY, 10000L)
|
||||
.apply();
|
||||
|
||||
final SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
||||
mCachedValuesHelper.getCachedAppsStorageResult();
|
||||
final SparseArray<StorageAsyncLoader.StorageResult> result =
|
||||
mCachedValuesHelper.getCachedStorageResult();
|
||||
assertThat(result).isNull();
|
||||
}
|
||||
|
||||
@@ -255,9 +261,9 @@ public class CachedStorageValuesHelperTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getCachedAppsStorageResult_nullIfEmpty() {
|
||||
final SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
||||
mCachedValuesHelper.getCachedAppsStorageResult();
|
||||
public void getCachedStorageResult_nullIfEmpty() {
|
||||
final SparseArray<StorageAsyncLoader.StorageResult> result =
|
||||
mCachedValuesHelper.getCachedStorageResult();
|
||||
assertThat(result).isNull();
|
||||
}
|
||||
|
||||
@@ -266,13 +272,13 @@ public class CachedStorageValuesHelperTest {
|
||||
when(mMockClock.getCurrentTime()).thenReturn(10000L);
|
||||
final StorageStatsSource.ExternalStorageStats externalStats =
|
||||
new StorageStatsSource.ExternalStorageStats(22222L, 2L, 20L, 200L, 2000L);
|
||||
final StorageAsyncLoader.AppsStorageResult result =
|
||||
new StorageAsyncLoader.AppsStorageResult();
|
||||
final StorageAsyncLoader.StorageResult result =
|
||||
new StorageAsyncLoader.StorageResult();
|
||||
result.gamesSize = 1L;
|
||||
result.musicAppsSize = 10L;
|
||||
result.videoAppsSize = 100L;
|
||||
result.photosAppsSize = 1000L;
|
||||
result.otherAppsSize = 10000L;
|
||||
result.audioSize = 10L;
|
||||
result.videosSize = 100L;
|
||||
result.imagesSize = 1000L;
|
||||
result.allAppsExceptGamesSize = 10000L;
|
||||
result.cacheSize = 100000L;
|
||||
result.externalStats = externalStats;
|
||||
final PrivateStorageInfo info = new PrivateStorageInfo(1000L, 6000L);
|
||||
@@ -280,9 +286,9 @@ public class CachedStorageValuesHelperTest {
|
||||
mCachedValuesHelper.cacheResult(info, result);
|
||||
|
||||
assertThat(mSharedPreferences.getLong(GAME_APPS_SIZE_KEY, -1)).isEqualTo(1L);
|
||||
assertThat(mSharedPreferences.getLong(MUSIC_APPS_SIZE_KEY, -1)).isEqualTo(10L);
|
||||
assertThat(mSharedPreferences.getLong(VIDEO_APPS_SIZE_KEY, -1)).isEqualTo(100L);
|
||||
assertThat(mSharedPreferences.getLong(PHOTO_APPS_SIZE_KEY, -1)).isEqualTo(1000L);
|
||||
assertThat(mSharedPreferences.getLong(AUDIO_SIZE_KEY, -1)).isEqualTo(10L);
|
||||
assertThat(mSharedPreferences.getLong(VIDEOS_SIZE_KEY, -1)).isEqualTo(100L);
|
||||
assertThat(mSharedPreferences.getLong(IMAGES_SIZE_KEY, -1)).isEqualTo(1000L);
|
||||
assertThat(mSharedPreferences.getLong(OTHER_APPS_SIZE_KEY, -1)).isEqualTo(10000L);
|
||||
assertThat(mSharedPreferences.getLong(CACHE_APPS_SIZE_KEY, -1)).isEqualTo(100000L);
|
||||
assertThat(mSharedPreferences.getLong(EXTERNAL_TOTAL_BYTES, -1)).isEqualTo(22222L);
|
||||
|
@@ -103,7 +103,7 @@ public class SecondaryUserControllerTest {
|
||||
verify(mGroup).addPreference(argumentCaptor.capture());
|
||||
|
||||
final Preference preference = argumentCaptor.getValue();
|
||||
assertThat(preference.getSummary()).isEqualTo("0.01 GB");
|
||||
assertThat(preference.getSummary()).isEqualTo("10 MB");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -201,9 +201,9 @@ public class SecondaryUserControllerTest {
|
||||
mPrimaryUser.name = TEST_NAME;
|
||||
mPrimaryUser.id = 10;
|
||||
mController.displayPreference(mScreen);
|
||||
final StorageAsyncLoader.AppsStorageResult userResult =
|
||||
new StorageAsyncLoader.AppsStorageResult();
|
||||
final SparseArray<StorageAsyncLoader.AppsStorageResult> result = new SparseArray<>();
|
||||
final StorageAsyncLoader.StorageResult userResult =
|
||||
new StorageAsyncLoader.StorageResult();
|
||||
final SparseArray<StorageAsyncLoader.StorageResult> result = new SparseArray<>();
|
||||
userResult.externalStats =
|
||||
new StorageStatsSource.ExternalStorageStats(
|
||||
MEGABYTE_IN_BYTES * 30,
|
||||
@@ -217,7 +217,7 @@ public class SecondaryUserControllerTest {
|
||||
verify(mGroup).addPreference(argumentCaptor.capture());
|
||||
final Preference preference = argumentCaptor.getValue();
|
||||
|
||||
assertThat(preference.getSummary()).isEqualTo("0.03 GB");
|
||||
assertThat(preference.getSummary()).isEqualTo("30 MB");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -16,6 +16,8 @@
|
||||
package com.android.settings.deviceinfo.storage;
|
||||
|
||||
import static com.android.settings.applications.manageapplications.ManageApplications.EXTRA_WORK_ID;
|
||||
import static com.android.settings.utils.FileSizeFormatter.GIGABYTE_IN_BYTES;
|
||||
import static com.android.settings.utils.FileSizeFormatter.KILOBYTE_IN_BYTES;
|
||||
import static com.android.settings.utils.FileSizeFormatter.MEGABYTE_IN_BYTES;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
@@ -336,12 +338,14 @@ public class StorageItemPreferenceControllerTest {
|
||||
mController.displayPreference(mPreferenceScreen);
|
||||
|
||||
mController.setUsedSize(MEGABYTE_IN_BYTES * 970); // There should 870MB attributed.
|
||||
final StorageAsyncLoader.AppsStorageResult result =
|
||||
new StorageAsyncLoader.AppsStorageResult();
|
||||
final StorageAsyncLoader.StorageResult result = new StorageAsyncLoader.StorageResult();
|
||||
result.gamesSize = MEGABYTE_IN_BYTES * 80;
|
||||
result.videoAppsSize = MEGABYTE_IN_BYTES * 160;
|
||||
result.musicAppsSize = MEGABYTE_IN_BYTES * 40;
|
||||
result.otherAppsSize = MEGABYTE_IN_BYTES * 90;
|
||||
result.imagesSize = MEGABYTE_IN_BYTES * 350;
|
||||
result.videosSize = GIGABYTE_IN_BYTES * 30;
|
||||
result.audioSize = MEGABYTE_IN_BYTES * 40;
|
||||
result.documentsAndOtherSize = MEGABYTE_IN_BYTES * 50;
|
||||
result.trashSize = KILOBYTE_IN_BYTES * 100;
|
||||
result.allAppsExceptGamesSize = MEGABYTE_IN_BYTES * 90;
|
||||
result.externalStats =
|
||||
new StorageStatsSource.ExternalStorageStats(
|
||||
MEGABYTE_IN_BYTES * 500, // total
|
||||
@@ -349,17 +353,18 @@ public class StorageItemPreferenceControllerTest {
|
||||
MEGABYTE_IN_BYTES * 150, // video
|
||||
MEGABYTE_IN_BYTES * 200, 0); // image
|
||||
|
||||
final SparseArray<StorageAsyncLoader.AppsStorageResult> results = new SparseArray<>();
|
||||
final SparseArray<StorageAsyncLoader.StorageResult> results = new SparseArray<>();
|
||||
results.put(0, result);
|
||||
mController.onLoadFinished(results, 0);
|
||||
|
||||
assertThat(mController.mImagesPreference.getSummary().toString()).isEqualTo("0.35 GB");
|
||||
assertThat(mController.mVideosPreference.getSummary().toString()).isEqualTo("0.16 GB");
|
||||
assertThat(mController.mAudioPreference.getSummary().toString()).isEqualTo("0.14 GB");
|
||||
assertThat(mController.mAppsPreference.getSummary().toString()).isEqualTo("0.09 GB");
|
||||
assertThat(mController.mGamesPreference.getSummary().toString()).isEqualTo("0.08 GB");
|
||||
assertThat(mController.mImagesPreference.getSummary().toString()).isEqualTo("350 MB");
|
||||
assertThat(mController.mVideosPreference.getSummary().toString()).isEqualTo("30 GB");
|
||||
assertThat(mController.mAudioPreference.getSummary().toString()).isEqualTo("40 MB");
|
||||
assertThat(mController.mAppsPreference.getSummary().toString()).isEqualTo("90 MB");
|
||||
assertThat(mController.mGamesPreference.getSummary().toString()).isEqualTo("80 MB");
|
||||
assertThat(mController.mDocumentsAndOtherPreference.getSummary().toString())
|
||||
.isEqualTo("0.05 GB");
|
||||
.isEqualTo("50 MB");
|
||||
assertThat(mController.mTrashPreference.getSummary().toString()).isEqualTo("100 kB");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user