Fix testFullDisk test case in split view settings
Test case couldn't find the proper "Storage" menu in the split view settings configuration.
Bug: 205883507
Test: run cts --module CtsAppSecurityHostTestCases --test android.appsecurity.cts.StorageHostTest#testFullDisk --bugreport-on-failure
Signed-off-by: Sungmin <sungmin.h@samsung.com>
Change-Id: Id0036ff4b92567f6d0cc50c48505d2db28e0167e
diff --git a/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/StorageTest.java b/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/StorageTest.java
index 18ef7c8..8f41f0a 100644
--- a/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/StorageTest.java
+++ b/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/StorageTest.java
@@ -117,11 +117,15 @@
}
private void clearSpaceGeneric(UiDevice device) throws UiObjectNotFoundException {
- UiScrollable uiScrollable = new UiScrollable(new UiSelector().scrollable(true));
- try {
- uiScrollable.scrollIntoView(new UiSelector().textContains("internal storage"));
- } catch (UiObjectNotFoundException e) {
- // Scrolling can fail if the UI is not scrollable
+ int i = device.findObjects(android.support.test.uiautomator.By.scrollable(true)).size();
+ for (int j = 0; j < i; j++) {
+ UiScrollable localObject = new UiScrollable(new UiSelector().scrollable(true).instance(j));
+ ((UiScrollable) localObject).setMaxSearchSwipes(10);
+ try {
+ ((UiScrollable) localObject).scrollTextIntoView("internal storage");
+ } catch (UiObjectNotFoundException localUiObjectNotFoundException) {
+ // Scrolling can fail if the UI is not scrollable
+ }
}
device.findObject(new UiSelector().textContains("internal storage")).click();
device.waitForIdle();