Update cachedStorageValueHelperTest to sdk 26
Test: make RunSettingsRoboTests -j40 Change-Id: Ia73a89d10727910545724f121ffc07ae306ec185
This commit is contained in:
@@ -55,7 +55,7 @@ import org.robolectric.annotation.Config;
|
|||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class CachedStorageValuesHelperTest {
|
public class CachedStorageValuesHelperTest {
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ public class CachedStorageValuesHelperTest {
|
|||||||
.putLong(TIMESTAMP_KEY, 10000L)
|
.putLong(TIMESTAMP_KEY, 10000L)
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
|
final PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
|
||||||
|
|
||||||
assertThat(info.freeBytes).isEqualTo(1000L);
|
assertThat(info.freeBytes).isEqualTo(1000L);
|
||||||
assertThat(info.totalBytes).isEqualTo(6000L);
|
assertThat(info.totalBytes).isEqualTo(6000L);
|
||||||
@@ -122,7 +122,7 @@ public class CachedStorageValuesHelperTest {
|
|||||||
.putLong(TIMESTAMP_KEY, 10000L)
|
.putLong(TIMESTAMP_KEY, 10000L)
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
final SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
||||||
mCachedValuesHelper.getCachedAppsStorageResult();
|
mCachedValuesHelper.getCachedAppsStorageResult();
|
||||||
|
|
||||||
StorageAsyncLoader.AppsStorageResult primaryResult = result.get(0);
|
StorageAsyncLoader.AppsStorageResult primaryResult = result.get(0);
|
||||||
@@ -161,7 +161,7 @@ public class CachedStorageValuesHelperTest {
|
|||||||
.putLong(TIMESTAMP_KEY, 10000L)
|
.putLong(TIMESTAMP_KEY, 10000L)
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
|
final PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
|
||||||
assertThat(info).isNull();
|
assertThat(info).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ public class CachedStorageValuesHelperTest {
|
|||||||
.putLong(TIMESTAMP_KEY, 10000L)
|
.putLong(TIMESTAMP_KEY, 10000L)
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
final SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
||||||
mCachedValuesHelper.getCachedAppsStorageResult();
|
mCachedValuesHelper.getCachedAppsStorageResult();
|
||||||
assertThat(result).isNull();
|
assertThat(result).isNull();
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ public class CachedStorageValuesHelperTest {
|
|||||||
.putLong(TIMESTAMP_KEY, 10000L)
|
.putLong(TIMESTAMP_KEY, 10000L)
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
|
final PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
|
||||||
assertThat(info).isNull();
|
assertThat(info).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,20 +240,20 @@ public class CachedStorageValuesHelperTest {
|
|||||||
.putLong(TIMESTAMP_KEY, 10000L)
|
.putLong(TIMESTAMP_KEY, 10000L)
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
final SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
||||||
mCachedValuesHelper.getCachedAppsStorageResult();
|
mCachedValuesHelper.getCachedAppsStorageResult();
|
||||||
assertThat(result).isNull();
|
assertThat(result).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getCachedPrivateStorageInfo_nullIfEmpty() throws Exception {
|
public void getCachedPrivateStorageInfo_nullIfEmpty() throws Exception {
|
||||||
PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
|
final PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
|
||||||
assertThat(info).isNull();
|
assertThat(info).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getCachedAppsStorageResult_nullIfEmpty() throws Exception {
|
public void getCachedAppsStorageResult_nullIfEmpty() throws Exception {
|
||||||
SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
final SparseArray<StorageAsyncLoader.AppsStorageResult> result =
|
||||||
mCachedValuesHelper.getCachedAppsStorageResult();
|
mCachedValuesHelper.getCachedAppsStorageResult();
|
||||||
assertThat(result).isNull();
|
assertThat(result).isNull();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user