summaryrefslogtreecommitdiffstats
path: root/tests/tapl/com/android/launcher3/tapl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tapl/com/android/launcher3/tapl')
-rw-r--r--tests/tapl/com/android/launcher3/tapl/Background.java32
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java6
-rw-r--r--tests/tapl/com/android/launcher3/tapl/Workspace.java4
3 files changed, 30 insertions, 12 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java
index 6c4619235..c9eaf276d 100644
--- a/tests/tapl/com/android/launcher3/tapl/Background.java
+++ b/tests/tapl/com/android/launcher3/tapl/Background.java
@@ -87,16 +87,24 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
}
case TWO_BUTTON: {
- final int centerX = mLauncher.getDevice().getDisplayWidth() / 2;
- final int startY = getSwipeStartY();
- final int swipeHeight = mLauncher.getTestInfo(getSwipeHeightRequestName()).
- getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD);
-
- mLauncher.swipeToState(
- centerX, startY, centerX,
- startY - swipeHeight - mLauncher.getTouchSlop(),
- 10,
- expectedState);
+ final int startX;
+ final int startY;
+ final int endX;
+ final int endY;
+ final int swipeLength = mLauncher.getTestInfo(getSwipeHeightRequestName()).
+ getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD) + mLauncher.getTouchSlop();
+
+ if (mLauncher.getDevice().isNaturalOrientation()) {
+ startX = endX = mLauncher.getDevice().getDisplayWidth() / 2;
+ startY = getSwipeStartY();
+ endY = startY - swipeLength;
+ } else {
+ startX = getSwipeStartX();
+ endX = startX - swipeLength;
+ startY = endY = mLauncher.getDevice().getDisplayHeight() / 2;
+ }
+
+ mLauncher.swipeToState(startX, startY, endX, endY, 10, expectedState);
break;
}
@@ -111,6 +119,10 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
return TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT;
}
+ protected int getSwipeStartX() {
+ return mLauncher.getRealDisplaySize().x - 1;
+ }
+
protected int getSwipeStartY() {
return mLauncher.getRealDisplaySize().y - 1;
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index f4e64c19d..22b04fb04 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -333,7 +333,11 @@ public final class LauncherInstrumentation {
"but the current state is not " + containerType.name())) {
switch (containerType) {
case WORKSPACE: {
- waitForLauncherObject(APPS_RES_ID);
+ if (mDevice.isNaturalOrientation()) {
+ waitForLauncherObject(APPS_RES_ID);
+ } else {
+ waitUntilGone(APPS_RES_ID);
+ }
waitUntilGone(OVERVIEW_RES_ID);
waitUntilGone(WIDGETS_RES_ID);
return waitForLauncherObject(WORKSPACE_RES_ID);
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index 33754c125..26c7b8f30 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -213,6 +213,8 @@ public final class Workspace extends Home {
@Override
protected int getSwipeStartY() {
- return mLauncher.waitForLauncherObject("hotseat").getVisibleBounds().top;
+ return mLauncher.getDevice().isNaturalOrientation() ?
+ mLauncher.waitForLauncherObject("hotseat").getVisibleBounds().top
+ : mLauncher.getRealDisplaySize().y - 1;
}
} \ No newline at end of file