Merge "Branching Taskbar visible/hidden assertion from testQuickSwitchToPreviousAppForTablet" into udc-qpr-dev am: 8997e5626a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23899920 Change-Id: If6475c36d108b820b0a0ab0a9ad94654c89179c6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.quickstep;
|
package com.android.quickstep;
|
||||||
|
|
||||||
|
import static com.android.launcher3.testing.shared.TestProtocol.FLAKY_QUICK_SWITCH_TO_PREVIOUS_APP;
|
||||||
import static com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName;
|
import static com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName;
|
||||||
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
|
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@ import static org.junit.Assume.assumeTrue;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.platform.test.annotations.PlatinumTest;
|
import android.platform.test.annotations.PlatinumTest;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.test.filters.LargeTest;
|
import androidx.test.filters.LargeTest;
|
||||||
import androidx.test.platform.app.InstrumentationRegistry;
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
@@ -44,6 +46,7 @@ import com.android.launcher3.tapl.OverviewActions;
|
|||||||
import com.android.launcher3.tapl.OverviewTask;
|
import com.android.launcher3.tapl.OverviewTask;
|
||||||
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
|
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
|
||||||
import com.android.launcher3.ui.TaplTestsLauncher3;
|
import com.android.launcher3.ui.TaplTestsLauncher3;
|
||||||
|
import com.android.launcher3.util.DisplayController;
|
||||||
import com.android.launcher3.util.Wait;
|
import com.android.launcher3.util.Wait;
|
||||||
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
|
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
|
||||||
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
|
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
|
||||||
@@ -144,7 +147,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
|
|||||||
assertNotNull("overview.getCurrentTask() returned null (1)", task);
|
assertNotNull("overview.getCurrentTask() returned null (1)", task);
|
||||||
assertNotNull("OverviewTask.open returned null", task.open());
|
assertNotNull("OverviewTask.open returned null", task.open());
|
||||||
assertTrue("Test activity didn't open from Overview", mDevice.wait(Until.hasObject(
|
assertTrue("Test activity didn't open from Overview", mDevice.wait(Until.hasObject(
|
||||||
By.pkg(getAppPackageName()).text("TestActivity2")),
|
By.pkg(getAppPackageName()).text("TestActivity2")),
|
||||||
DEFAULT_UI_TIMEOUT));
|
DEFAULT_UI_TIMEOUT));
|
||||||
executeOnLauncher(launcher -> assertTrue(
|
executeOnLauncher(launcher -> assertTrue(
|
||||||
"Launcher activity is the top activity; expecting another activity to be the top "
|
"Launcher activity is the top activity; expecting another activity to be the top "
|
||||||
@@ -313,7 +316,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
|
|||||||
@Test
|
@Test
|
||||||
@ScreenRecord // b/242163205
|
@ScreenRecord // b/242163205
|
||||||
@PlatinumTest(focusArea = "launcher")
|
@PlatinumTest(focusArea = "launcher")
|
||||||
@TaskbarModeSwitch(mode = PERSISTENT)
|
|
||||||
public void testQuickSwitchToPreviousAppForTablet() throws Exception {
|
public void testQuickSwitchToPreviousAppForTablet() throws Exception {
|
||||||
assumeTrue(mLauncher.isTablet());
|
assumeTrue(mLauncher.isTablet());
|
||||||
startTestActivity(2);
|
startTestActivity(2);
|
||||||
@@ -331,9 +333,18 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
|
|||||||
|
|
||||||
assertTrue("The first app we should have quick switched to is not running",
|
assertTrue("The first app we should have quick switched to is not running",
|
||||||
isTestActivityRunning(2));
|
isTestActivityRunning(2));
|
||||||
// Expect task bar visible when the launched app was the test activity.
|
|
||||||
launchedAppState = getAndAssertLaunchedApp();
|
launchedAppState = getAndAssertLaunchedApp();
|
||||||
launchedAppState.assertTaskbarVisible();
|
|
||||||
|
Log.e(FLAKY_QUICK_SWITCH_TO_PREVIOUS_APP,
|
||||||
|
"is Taskbar Transient : " + DisplayController.isTransientTaskbar(mTargetContext));
|
||||||
|
// TODO(b/286084688): Remove this branching check after test corruption is resolved.
|
||||||
|
// Branching this check because of test corruption.
|
||||||
|
if (DisplayController.isTransientTaskbar(mTargetContext)) {
|
||||||
|
launchedAppState.assertTaskbarHidden();
|
||||||
|
} else {
|
||||||
|
launchedAppState.assertTaskbarVisible();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTestActivityRunning(int activityNumber) {
|
private boolean isTestActivityRunning(int activityNumber) {
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ public final class TestProtocol {
|
|||||||
public static final String PERMANENT_DIAG_TAG = "TaplTarget";
|
public static final String PERMANENT_DIAG_TAG = "TaplTarget";
|
||||||
public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
|
public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
|
||||||
public static final String FLAKY_ACTIVITY_COUNT = "b/260260325";
|
public static final String FLAKY_ACTIVITY_COUNT = "b/260260325";
|
||||||
|
public static final String FLAKY_QUICK_SWITCH_TO_PREVIOUS_APP = "b/286084688";
|
||||||
public static final String ICON_MISSING = "b/282963545";
|
public static final String ICON_MISSING = "b/282963545";
|
||||||
public static final String LAUNCH_SPLIT_PAIR = "b/288939273";
|
public static final String LAUNCH_SPLIT_PAIR = "b/288939273";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user