Increased layout timeout to handle older devices
This test specifically creates 1000 adapter items, and
StaggeredGridLayoutManager doesn't have enough time to finish layout in
only 3 seconds on older devices (it was flaky on Nexus 5 API 23).
Increased the layout timeout pass to 10 seconds.
Bug: 34073965
Test: ./gradlew support-recyclerview-v7:connectedCheck
-Pandroid.testInstrumentationRunnerArguments.class=android.support.v7.widget.StaggeredGridLayoutManagerTest#focusSearchFailureFromSubChild
Change-Id: I8d242ac7a7533b658865fda156ad23a5ac15a229
diff --git a/v7/recyclerview/tests/src/android/support/v7/widget/StaggeredGridLayoutManagerTest.java b/v7/recyclerview/tests/src/android/support/v7/widget/StaggeredGridLayoutManagerTest.java
index 64111c5..d92b169 100644
--- a/v7/recyclerview/tests/src/android/support/v7/widget/StaggeredGridLayoutManagerTest.java
+++ b/v7/recyclerview/tests/src/android/support/v7/widget/StaggeredGridLayoutManagerTest.java
@@ -279,7 +279,10 @@
item.mText + " (" + item.mId + ")");
}
});
- waitFirstLayout();
+ mLayoutManager.expectLayouts(1);
+ setRecyclerView(mRecyclerView);
+ mLayoutManager.waitForLayout(10);
+ getInstrumentation().waitForIdleSync();
ViewGroup lastChild = (ViewGroup) mRecyclerView.getChildAt(
mRecyclerView.getChildCount() - 1);
RecyclerView.ViewHolder lastViewHolder = mRecyclerView.getChildViewHolder(lastChild);