Go home before getting overview in test to ensure overview will exist.
Also when opening settings, do not wait for A11Y event which never fires. (added in ag/24777489, but seems to fail as mentioned here b/303329286#comment2 and tracked here b/298114205)
Fix: 307379525
Fix: 307397957
Bug: 298114205
Flag: ACONFIG com.android.launcher3.enable_overview_icon_menu TRUNKFOOD
Test: TaplOverviewIconTest
Change-Id: Icd8a47b47d22ddb32db7df6882ec655f0e6f54c1
diff --git a/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java b/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
index eba3252..f6368b0 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
@@ -82,7 +82,7 @@
taskMenu.touchOutsideTaskMenuToDismiss();
OverviewTaskMenu splitMenu =
- mLauncher.getOverview().getCurrentTask().tapSplitTaskMenu();
+ mLauncher.goHome().switchToOverview().getCurrentTask().tapSplitTaskMenu();
assertTrue("App info item not appearing in expanded split task's menu.",
splitMenu.hasMenuItem("App info"));
splitMenu.touchOutsideTaskMenuToDismiss();
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java b/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java
index 25c73de..38cc321 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTaskMenu.java
@@ -16,8 +16,6 @@
package com.android.launcher3.tapl;
-import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
-
import androidx.annotation.NonNull;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.UiObject2;
@@ -61,14 +59,8 @@
try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
"before tapping the app info menu item")) {
-
- mLauncher.executeAndWaitForLauncherEvent(
- () -> mLauncher.clickLauncherObject(
- mLauncher.findObjectInContainer(mMenu, By.text("App info"))),
- accessibilityEvent ->
- accessibilityEvent.getEventType() == TYPE_WINDOW_STATE_CHANGED,
- () -> "Unable to start Settings by clicking App Info",
- "Tap the app info menu item");
+ mLauncher.clickLauncherObject(
+ mLauncher.findObjectInContainer(mMenu, By.text("App info")));
try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
"tapped app info menu item")) {