diff options
| author | 2023-04-05 21:34:47 -0700 | |
|---|---|---|
| committer | 2023-04-07 08:23:02 -0700 | |
| commit | a36c4deb98e45aa0994b3f5fe2937fb112d03451 (patch) | |
| tree | bfa6505e7911b50fe997844968d4010230b6d2bf /java/tests | |
| parent | 8a12f04a6116232ecd40a65ae6ba2f24234990ec (diff) | |
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
Diffstat (limited to 'java/tests')
| -rw-r--r-- | java/tests/src/com/android/intentresolver/UnbundledChooserActivityTest.java | 17 |
1 files changed, 5 insertions, 12 deletions
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<View> 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))); }); } |