Merge "Shows "This device" for default internal storage" into sc-dev am: 8b5913ba18 am: e7e25f12f1 am: 766ddfce34
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14609996 Change-Id: Ie925d28907b45da43cb43391ddd39c65ef342d00
This commit is contained in:
@@ -31,6 +31,8 @@ import android.os.storage.VolumeRecord;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.android.settings.testutils.ResourcesUtils;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -246,6 +248,17 @@ public class StorageEntryTest {
|
||||
assertThat(recordStorage.getDescription()).isEqualTo(description);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getDescription_defaultInternalStorage_returnThisDevice() {
|
||||
final VolumeInfo volumeInfo = mock(VolumeInfo.class);
|
||||
when(volumeInfo.getType()).thenReturn(VolumeInfo.TYPE_PRIVATE);
|
||||
when(volumeInfo.getId()).thenReturn(VolumeInfo.ID_PRIVATE_INTERNAL);
|
||||
final StorageEntry volumeStorage = new StorageEntry(mContext, volumeInfo);
|
||||
|
||||
assertThat(volumeStorage.getDescription()).isEqualTo(
|
||||
ResourcesUtils.getResourcesString(mContext, "storage_default_internal_storage"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getDiskId_shouldReturnDiskId() {
|
||||
final VolumeInfo volumeInfo = mock(VolumeInfo.class);
|
||||
|
||||
Reference in New Issue
Block a user