Merge "Update save app pair test to validate when icon chip menu is disabled" into main
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
index ec8e00d..2a54057 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
@@ -117,18 +117,21 @@
}
@Test
- public void testSaveAppPairMenuItemExistsOnSplitPair() throws Exception {
+ public void testSaveAppPairMenuItemOrActionExistsOnSplitPair() {
assumeTrue("App pairs feature is currently not enabled, no test needed",
Flags.enableAppPairs());
createAndLaunchASplitPair();
- assertTrue("Save app pair menu item is missing",
- mLauncher.goHome()
- .switchToOverview()
- .getCurrentTask()
- .tapMenu()
- .hasMenuItem("Save app pair"));
+ Overview overview = mLauncher.goHome().switchToOverview();
+ if (mLauncher.isGridOnlyOverviewEnabled() || !mLauncher.isTablet()) {
+ assertTrue("Save app pair menu item is missing",
+ overview.getCurrentTask()
+ .tapMenu()
+ .hasMenuItem("Save app pair"));
+ } else {
+ overview.getOverviewActions().assertHasAction("Save app pair");
+ }
}
@Test
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
index d7c40a0..486a63b 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewActions.java
@@ -17,6 +17,7 @@
package com.android.launcher3.tapl;
import androidx.annotation.NonNull;
+import androidx.test.uiautomator.By;
import androidx.test.uiautomator.UiObject2;
/**
@@ -110,4 +111,12 @@
}
}
}
+
+ /** Asserts that an item matching the given string is present in the overview actions. */
+ public void assertHasAction(String text) {
+ try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+ "want to check if the action [" + text + "] is present")) {
+ mLauncher.waitForObjectInContainer(mOverviewActions, By.text(text));
+ }
+ }
}