From a36c4deb98e45aa0994b3f5fe2937fb112d03451 Mon Sep 17 00:00:00 2001 From: Andrey Epin Date: Wed, 5 Apr 2023 21:34:47 -0700 Subject: Replace view stubs with actual views With the feature flags removed, there are no layout variations for action row and image preivew anymore thus ViewStubs can be replaced with the actual views. Bug: 267355521 Bug: 266983432 Test: manual testing Change-Id: I96a3a3560bfa5f1fbf064bd6080c618467c7aca1 --- .../intentresolver/UnbundledChooserActivityTest.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'java/tests/src') diff --git a/java/tests/src/com/android/intentresolver/UnbundledChooserActivityTest.java b/java/tests/src/com/android/intentresolver/UnbundledChooserActivityTest.java index eb340224..39357a4d 100644 --- a/java/tests/src/com/android/intentresolver/UnbundledChooserActivityTest.java +++ b/java/tests/src/com/android/intentresolver/UnbundledChooserActivityTest.java @@ -91,7 +91,6 @@ import android.util.HashedStringCache; import android.util.Pair; import android.util.SparseArray; import android.view.View; -import android.view.ViewGroup; import androidx.annotation.CallSuper; import androidx.annotation.NonNull; @@ -919,23 +918,17 @@ public class UnbundledChooserActivityTest { setupResolverControllers(resolvedComponentInfos); mActivityRule.launchActivity(Intent.createChooser(sendIntent, null)); waitForIdle(); - onView(withId(com.android.internal.R.id.content_preview_image_area)) + onView(withId(R.id.scrollable_image_preview)) .check((view, exception) -> { if (exception != null) { throw exception; } - ViewGroup parent = (ViewGroup) view; - ArrayList visibleViews = new ArrayList<>(); - for (int i = 0, count = parent.getChildCount(); i < count; i++) { - View child = parent.getChildAt(i); - if (child.getVisibility() == View.VISIBLE) { - visibleViews.add(child); - } - } - assertThat(visibleViews.size(), is(1)); + RecyclerView recyclerView = (RecyclerView) view; + assertThat(recyclerView.getAdapter().getItemCount(), is(1)); + assertThat(recyclerView.getChildCount(), is(1)); assertThat( "image preview view is fully visible", - isDisplayed().matches(visibleViews.get(0))); + isDisplayed().matches(recyclerView.getChildAt(0))); }); } -- cgit v1.2.3-59-g8ed1b