use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project android_packages_apps_Settings by crdroidandroid.
the class CachedStorageValuesHelperTest method getCachedPrivateStorageInfo_nullIfEmpty.
@Test
public void getCachedPrivateStorageInfo_nullIfEmpty() throws Exception {
PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
assertThat(info).isNull();
}
use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project android_packages_apps_Settings by crdroidandroid.
the class StorageDashboardFragmentTest method test_cacheProviderProvidesValuesIfBothCached.
@Test
public void test_cacheProviderProvidesValuesIfBothCached() {
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);
mFragment.setCachedStorageValuesHelper(helper);
mFragment.initializeCachedValues();
assertThat(mFragment.getPrivateStorageInfo()).isEqualTo(info);
assertThat(mFragment.getAppsStorageResult()).isEqualTo(result);
}
use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project android_packages_apps_Settings by crdroidandroid.
the class StorageDashboardFragmentTest method test_loadWhenQuotaOnAndVolumeInfoLoadedButAppsMissing.
@Test
public void test_loadWhenQuotaOnAndVolumeInfoLoadedButAppsMissing() {
View fakeView = mock(View.class, RETURNS_DEEP_STUBS);
RecyclerView fakeRecyclerView = mock(RecyclerView.class, RETURNS_DEEP_STUBS);
when(fakeView.findViewById(anyInt())).thenReturn(fakeView);
mFragment = spy(mFragment);
when(mFragment.getView()).thenReturn(fakeView);
when(mFragment.getListView()).thenReturn(fakeRecyclerView);
PrivateStorageInfo info = new PrivateStorageInfo(0, 0);
mFragment.setPrivateStorageInfo(info);
mFragment.maybeSetLoading(true);
verify(mFragment).setLoading(true, false);
}
use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project android_packages_apps_Settings by crdroidandroid.
the class StorageDashboardFragmentTest method test_dontLoadWhenQuotaOnAndAllLoaded.
@Test
public void test_dontLoadWhenQuotaOnAndAllLoaded() {
View fakeView = mock(View.class, RETURNS_DEEP_STUBS);
RecyclerView fakeRecyclerView = mock(RecyclerView.class, RETURNS_DEEP_STUBS);
when(fakeView.findViewById(anyInt())).thenReturn(fakeView);
mFragment = spy(mFragment);
when(mFragment.getView()).thenReturn(fakeView);
when(mFragment.getListView()).thenReturn(fakeRecyclerView);
mFragment.setAppsStorageResult(new SparseArray<>());
PrivateStorageInfo storageInfo = new PrivateStorageInfo(0, 0);
mFragment.setPrivateStorageInfo(storageInfo);
mFragment.maybeSetLoading(true);
verify(mFragment, never()).setLoading(true, false);
}
use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project android_packages_apps_Settings by SudaMod.
the class StorageDashboardFragmentTest method test_loadWhenQuotaOnAndVolumeInfoLoadedButAppsMissing.
@Test
public void test_loadWhenQuotaOnAndVolumeInfoLoadedButAppsMissing() {
View fakeView = mock(View.class, RETURNS_DEEP_STUBS);
RecyclerView fakeRecyclerView = mock(RecyclerView.class, RETURNS_DEEP_STUBS);
when(fakeView.findViewById(anyInt())).thenReturn(fakeView);
mFragment = spy(mFragment);
when(mFragment.getView()).thenReturn(fakeView);
when(mFragment.getListView()).thenReturn(fakeRecyclerView);
PrivateStorageInfo info = new PrivateStorageInfo(0, 0);
mFragment.setPrivateStorageInfo(info);
mFragment.maybeSetLoading(true);
verify(mFragment).setLoading(true, false);
}
Aggregations