Search in sources :

Example 11 with CachedStorageValuesHelper

use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project platform_packages_apps_Settings by BlissRoms.

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);
}
Also used : SparseArray(android.util.SparseArray) CachedStorageValuesHelper(com.android.settings.deviceinfo.storage.CachedStorageValuesHelper) PrivateStorageInfo(com.android.settingslib.deviceinfo.PrivateStorageInfo) Test(org.junit.Test)

Example 12 with CachedStorageValuesHelper

use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project platform_packages_apps_Settings by BlissRoms.

the class StorageDashboardFragmentTest method test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing.

@Test
public void test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing() {
    CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
    SparseArray<StorageAsyncLoader.AppsStorageResult> result = new SparseArray<>();
    when(helper.getCachedAppsStorageResult()).thenReturn(result);
    mFragment.setCachedStorageValuesHelper(helper);
    mFragment.initializeCachedValues();
    assertThat(mFragment.getPrivateStorageInfo()).isNull();
    assertThat(mFragment.getAppsStorageResult()).isNull();
}
Also used : SparseArray(android.util.SparseArray) CachedStorageValuesHelper(com.android.settings.deviceinfo.storage.CachedStorageValuesHelper) Test(org.junit.Test)

Example 13 with CachedStorageValuesHelper

use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project android_packages_apps_Settings by omnirom.

the class StorageDashboardFragmentTest method test_cacheProviderDoesntProvideValuesIfAppsMissing.

@Test
public void test_cacheProviderDoesntProvideValuesIfAppsMissing() {
    CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
    PrivateStorageInfo info = new PrivateStorageInfo(0, 0);
    when(helper.getCachedPrivateStorageInfo()).thenReturn(info);
    mFragment.setCachedStorageValuesHelper(helper);
    mFragment.initializeCachedValues();
    assertThat(mFragment.getPrivateStorageInfo()).isNull();
    assertThat(mFragment.getAppsStorageResult()).isNull();
}
Also used : CachedStorageValuesHelper(com.android.settings.deviceinfo.storage.CachedStorageValuesHelper) PrivateStorageInfo(com.android.settingslib.deviceinfo.PrivateStorageInfo) Test(org.junit.Test)

Example 14 with CachedStorageValuesHelper

use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project android_packages_apps_Settings by omnirom.

the class StorageDashboardFragmentTest method test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing.

@Test
public void test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing() {
    CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
    SparseArray<StorageAsyncLoader.AppsStorageResult> result = new SparseArray<>();
    when(helper.getCachedAppsStorageResult()).thenReturn(result);
    mFragment.setCachedStorageValuesHelper(helper);
    mFragment.initializeCachedValues();
    assertThat(mFragment.getPrivateStorageInfo()).isNull();
    assertThat(mFragment.getAppsStorageResult()).isNull();
}
Also used : SparseArray(android.util.SparseArray) CachedStorageValuesHelper(com.android.settings.deviceinfo.storage.CachedStorageValuesHelper) Test(org.junit.Test)

Example 15 with CachedStorageValuesHelper

use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class StorageDashboardFragmentTest method test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing.

@Test
public void test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing() {
    CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
    SparseArray<StorageAsyncLoader.AppsStorageResult> result = new SparseArray<>();
    when(helper.getCachedAppsStorageResult()).thenReturn(result);
    mFragment.setCachedStorageValuesHelper(helper);
    mFragment.initializeCachedValues();
    assertThat(mFragment.getPrivateStorageInfo()).isNull();
    assertThat(mFragment.getAppsStorageResult()).isNull();
}
Also used : SparseArray(android.util.SparseArray) CachedStorageValuesHelper(com.android.settings.deviceinfo.storage.CachedStorageValuesHelper) Test(org.junit.Test)

Aggregations

CachedStorageValuesHelper (com.android.settings.deviceinfo.storage.CachedStorageValuesHelper)28 Test (org.junit.Test)21 SparseArray (android.util.SparseArray)14 PrivateStorageInfo (com.android.settingslib.deviceinfo.PrivateStorageInfo)14