summaryrefslogtreecommitdiff
path: root/tests/activity
diff options
context:
space:
mode:
author Govinda Wasserman <gwasserman@google.com> 2024-05-16 16:36:56 -0400
committer Govinda Wasserman <gwasserman@google.com> 2024-05-21 14:32:32 -0400
commit97492540d111a1164c74a306b4d98aea11e543f3 (patch)
tree78b7f40c89e8fb74f8edcc6488d68dffeaf1c304 /tests/activity
parent25c04565081fd8643e04f88e004fc09ac1c73ff3 (diff)
Add ImageLoader with improved caching and cancelling
BUG: 339261453 FIX: 339261453 Test: atest CachingImagePreviewImageLoaderTest Test: atest IntentResolver-tests-activity Test: manual test using ShareTest Change-Id: I316a9f683a26f2f6d8599e0da4a45ca3f4e740ab
Diffstat (limited to 'tests/activity')
-rw-r--r--tests/activity/src/com/android/intentresolver/ChooserActivityTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/activity/src/com/android/intentresolver/ChooserActivityTest.java b/tests/activity/src/com/android/intentresolver/ChooserActivityTest.java
index 66f7650d..a16e201b 100644
--- a/tests/activity/src/com/android/intentresolver/ChooserActivityTest.java
+++ b/tests/activity/src/com/android/intentresolver/ChooserActivityTest.java
@@ -117,8 +117,12 @@ import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
import com.android.intentresolver.chooser.DisplayResolveInfo;
+import com.android.intentresolver.contentpreview.FakeThumbnailLoader;
import com.android.intentresolver.contentpreview.ImageLoader;
import com.android.intentresolver.contentpreview.ImageLoaderModule;
+import com.android.intentresolver.contentpreview.PreviewCacheSize;
+import com.android.intentresolver.contentpreview.PreviewMaxConcurrency;
+import com.android.intentresolver.contentpreview.ThumbnailLoader;
import com.android.intentresolver.data.repository.FakeUserRepository;
import com.android.intentresolver.data.repository.UserRepository;
import com.android.intentresolver.data.repository.UserRepositoryModule;
@@ -267,6 +271,17 @@ public class ChooserActivityTest {
@BindValue
final ImageLoader mImageLoader = mFakeImageLoader;
+ @BindValue
+ @PreviewCacheSize
+ int mPreviewCacheSize = 16;
+
+ @BindValue
+ @PreviewMaxConcurrency
+ int mPreviewMaxConcurrency = 4;
+
+ @BindValue
+ ThumbnailLoader mThumbnailLoader = new FakeThumbnailLoader();
+
@Before
public void setUp() {
// TODO: use the other form of `adoptShellPermissionIdentity()` where we explicitly list the