Loading tests/unit/com/android/documentsui/clipping/ClipStorageTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -22,12 +22,13 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import android.annotation.MainThread; import android.content.SharedPreferences; import android.net.Uri; import android.os.AsyncTask; import androidx.test.InstrumentationRegistry; import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.documentsui.testing.TestScheduledExecutorService; Loading @@ -46,6 +47,7 @@ import java.util.List; @RunWith(AndroidJUnit4.class) @SmallTest @MainThread public class ClipStorageTest { private static final String PREF_NAME = "pref"; private static final List<Uri> TEST_URIS = createList( Loading @@ -63,7 +65,8 @@ public class ClipStorageTest { @Before public void setUp() { mPref = InstrumentationRegistry.getContext().getSharedPreferences(PREF_NAME, 0); mPref = InstrumentationRegistry.getInstrumentation().getTargetContext() .getSharedPreferences(PREF_NAME, 0); File clipDir = ClipStorage.prepareStorage(folder.getRoot()); mStorage = new ClipStorage(clipDir, mPref); Loading tests/unit/com/android/documentsui/clipping/UrisSupplierTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ import android.net.Uri; import android.os.AsyncTask; import android.provider.DocumentsContract; import androidx.test.InstrumentationRegistry; import androidx.test.filters.MediumTest; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.documentsui.base.Shared; Loading Loading @@ -63,7 +63,8 @@ public class UrisSupplierTest { mExecutor = new TestScheduledExecutorService(); AsyncTask.setDefaultExecutor(mExecutor); mPref = InstrumentationRegistry.getContext().getSharedPreferences(PREF_NAME, 0); mPref = InstrumentationRegistry.getInstrumentation().getTargetContext() .getSharedPreferences(PREF_NAME, 0); mStorage = new ClipStorage(folder.getRoot(), mPref); } Loading Loading
tests/unit/com/android/documentsui/clipping/ClipStorageTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -22,12 +22,13 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import android.annotation.MainThread; import android.content.SharedPreferences; import android.net.Uri; import android.os.AsyncTask; import androidx.test.InstrumentationRegistry; import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.documentsui.testing.TestScheduledExecutorService; Loading @@ -46,6 +47,7 @@ import java.util.List; @RunWith(AndroidJUnit4.class) @SmallTest @MainThread public class ClipStorageTest { private static final String PREF_NAME = "pref"; private static final List<Uri> TEST_URIS = createList( Loading @@ -63,7 +65,8 @@ public class ClipStorageTest { @Before public void setUp() { mPref = InstrumentationRegistry.getContext().getSharedPreferences(PREF_NAME, 0); mPref = InstrumentationRegistry.getInstrumentation().getTargetContext() .getSharedPreferences(PREF_NAME, 0); File clipDir = ClipStorage.prepareStorage(folder.getRoot()); mStorage = new ClipStorage(clipDir, mPref); Loading
tests/unit/com/android/documentsui/clipping/UrisSupplierTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ import android.net.Uri; import android.os.AsyncTask; import android.provider.DocumentsContract; import androidx.test.InstrumentationRegistry; import androidx.test.filters.MediumTest; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.documentsui.base.Shared; Loading Loading @@ -63,7 +63,8 @@ public class UrisSupplierTest { mExecutor = new TestScheduledExecutorService(); AsyncTask.setDefaultExecutor(mExecutor); mPref = InstrumentationRegistry.getContext().getSharedPreferences(PREF_NAME, 0); mPref = InstrumentationRegistry.getInstrumentation().getTargetContext() .getSharedPreferences(PREF_NAME, 0); mStorage = new ClipStorage(folder.getRoot(), mPref); } Loading