Loading quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +4 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,10 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTrue("The second app we should have quick switched to is not running", isTestActivityRunning(2)); } background = getAndAssertBackground(); background.quickSwitchToPreviousAppSwipeLeft(); assertTrue("The 2nd app we should have quick switched to is not running", isTestActivityRunning(3)); getAndAssertBackground(); } Loading tests/tapl/com/android/launcher3/tapl/Background.java +45 −17 Original line number Diff line number Diff line Loading @@ -144,11 +144,22 @@ public class Background extends LauncherInstrumentation.VisibleContainer { private void expectSwitchToOverviewEvents() { } /** * Swipes right or double presses the square button to switch to the previous app. */ @NonNull public Background quickSwitchToPreviousApp() { boolean toRight = true; quickSwitch(toRight); return new Background(mLauncher); } @NonNull public Background quickSwitchToPreviousAppSwipeLeft() { boolean toRight = false; quickSwitch(toRight); return new Background(mLauncher); } @NonNull private void quickSwitch(boolean toRight) { try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck(); LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to quick switch to the previous app")) { Loading @@ -164,6 +175,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer { final int startY; final int endX; final int endY; if (toRight) { if (mLauncher.getDevice().isNaturalOrientation() || !transposeInLandscape) { // Swipe from the bottom left to the bottom right of the screen. startX = 0; Loading @@ -177,6 +189,22 @@ public class Background extends LauncherInstrumentation.VisibleContainer { endX = startX; endY = 0; } } else { if (mLauncher.getDevice().isNaturalOrientation() || !transposeInLandscape) { // Swipe from the bottom right to the bottom left of the screen. startX = mLauncher.getDevice().getDisplayWidth(); startY = getSwipeStartY(); endX = 0; endY = startY; } else { // Swipe from the bottom left to the top left of the screen. startX = getSwipeStartX(); startY = 0; endX = startX; endY = mLauncher.getRealDisplaySize().y - 1; } } final boolean isZeroButton = mLauncher.getNavigationModel() == LauncherInstrumentation.NavigationModel.ZERO_BUTTON; LauncherInstrumentation.GestureScope gestureScope = Loading Loading @@ -205,7 +233,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer { break; } mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, TASK_START_EVENT); return new Background(mLauncher); return; } } Loading Loading
quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +4 −0 Original line number Diff line number Diff line Loading @@ -310,6 +310,10 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { assertTrue("The second app we should have quick switched to is not running", isTestActivityRunning(2)); } background = getAndAssertBackground(); background.quickSwitchToPreviousAppSwipeLeft(); assertTrue("The 2nd app we should have quick switched to is not running", isTestActivityRunning(3)); getAndAssertBackground(); } Loading
tests/tapl/com/android/launcher3/tapl/Background.java +45 −17 Original line number Diff line number Diff line Loading @@ -144,11 +144,22 @@ public class Background extends LauncherInstrumentation.VisibleContainer { private void expectSwitchToOverviewEvents() { } /** * Swipes right or double presses the square button to switch to the previous app. */ @NonNull public Background quickSwitchToPreviousApp() { boolean toRight = true; quickSwitch(toRight); return new Background(mLauncher); } @NonNull public Background quickSwitchToPreviousAppSwipeLeft() { boolean toRight = false; quickSwitch(toRight); return new Background(mLauncher); } @NonNull private void quickSwitch(boolean toRight) { try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck(); LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to quick switch to the previous app")) { Loading @@ -164,6 +175,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer { final int startY; final int endX; final int endY; if (toRight) { if (mLauncher.getDevice().isNaturalOrientation() || !transposeInLandscape) { // Swipe from the bottom left to the bottom right of the screen. startX = 0; Loading @@ -177,6 +189,22 @@ public class Background extends LauncherInstrumentation.VisibleContainer { endX = startX; endY = 0; } } else { if (mLauncher.getDevice().isNaturalOrientation() || !transposeInLandscape) { // Swipe from the bottom right to the bottom left of the screen. startX = mLauncher.getDevice().getDisplayWidth(); startY = getSwipeStartY(); endX = 0; endY = startY; } else { // Swipe from the bottom left to the top left of the screen. startX = getSwipeStartX(); startY = 0; endX = startX; endY = mLauncher.getRealDisplaySize().y - 1; } } final boolean isZeroButton = mLauncher.getNavigationModel() == LauncherInstrumentation.NavigationModel.ZERO_BUTTON; LauncherInstrumentation.GestureScope gestureScope = Loading Loading @@ -205,7 +233,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer { break; } mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, TASK_START_EVENT); return new Background(mLauncher); return; } } Loading