Merge "Adding events check to TAPL method for flinging to clear all." into main
diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
index f633d48..214f158 100644
--- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
+++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
@@ -157,7 +157,7 @@
LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"dismissing all tasks")) {
final BySelector clearAllSelector = mLauncher.getOverviewObjectSelector("clear_all");
- flingForwardUntilClearAllVisible();
+ flingForwardUntilClearAllVisibleImpl();
final Runnable clickClearAll = () -> mLauncher.clickLauncherObject(
mLauncher.waitForObjectInContainer(verifyActiveContainer(),
@@ -181,10 +181,19 @@
* Scrolls until Clear-all button is visible.
*/
public void flingForwardUntilClearAllVisible() {
- final BySelector clearAllSelector = mLauncher.getOverviewObjectSelector("clear_all");
- for (int i = 0; i < FLINGS_FOR_DISMISS_LIMIT
- && !verifyActiveContainer().hasObject(clearAllSelector); ++i) {
- flingForwardImpl();
+ try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
+ flingForwardUntilClearAllVisibleImpl();
+ }
+ }
+
+ private void flingForwardUntilClearAllVisibleImpl() {
+ try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+ "flinging forward to clear all")) {
+ final BySelector clearAllSelector = mLauncher.getOverviewObjectSelector("clear_all");
+ for (int i = 0; i < FLINGS_FOR_DISMISS_LIMIT && !verifyActiveContainer().hasObject(
+ clearAllSelector); ++i) {
+ flingForwardImpl();
+ }
}
}