diff options
author | Tony Wickham <twickham@google.com> | 2019-10-15 15:24:39 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2019-10-15 17:30:47 -0700 |
commit | a0f77c4449753490adca6863cbf97c509e70e17a (patch) | |
tree | dfd74d086609c9e127b33c97da515758788510be /tests | |
parent | 91ac68284e0c0f027f16c442f92e630530f7233f (diff) | |
download | packages_apps_Trebuchet-a0f77c4449753490adca6863cbf97c509e70e17a.tar.gz packages_apps_Trebuchet-a0f77c4449753490adca6863cbf97c509e70e17a.tar.bz2 packages_apps_Trebuchet-a0f77c4449753490adca6863cbf97c509e70e17a.zip |
Fix quick switch test gesture in landscape 2-button mode
It should swipe from the bottom right to top right when the nav bar is
on the right, rather than from the bottom left to bottom right.
For now, disable testQuickSwitchFromApp() because it seems to have
other failures as well.
Bug: 140252765
Change-Id: I1f4989f3ea5456c18bb9cbf42ea4b157cee500d7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/Background.java | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java index 0dd3e775c..db3d846a0 100644 --- a/tests/tapl/com/android/launcher3/tapl/Background.java +++ b/tests/tapl/com/android/launcher3/tapl/Background.java @@ -132,15 +132,29 @@ public class Background extends LauncherInstrumentation.VisibleContainer { } protected void quickSwitchToPreviousApp(int expectedState) { + boolean transposeInLandscape = false; switch (mLauncher.getNavigationModel()) { - case ZERO_BUTTON: + case TWO_BUTTON: + transposeInLandscape = true; // Fall through, zero button and two button modes behave the same. - case TWO_BUTTON: { - // Swipe from the bottom left to the bottom right of the screen. - final int startX = 0; - final int startY = getSwipeStartY(); - final int endX = mLauncher.getDevice().getDisplayWidth(); - final int endY = startY; + case ZERO_BUTTON: { + final int startX; + final int startY; + final int endX; + final int endY; + if (mLauncher.getDevice().isNaturalOrientation() || !transposeInLandscape) { + // Swipe from the bottom left to the bottom right of the screen. + startX = 0; + startY = getSwipeStartY(); + endX = mLauncher.getDevice().getDisplayWidth(); + endY = startY; + } else { + // Swipe from the bottom right to the top right of the screen. + startX = getSwipeStartX(); + startY = mLauncher.getRealDisplaySize().y - 1; + endX = startX; + endY = 0; + } mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState); break; } |