diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Android.mk | 3 | ||||
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/AllApps.java | 6 | ||||
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 5 |
3 files changed, 9 insertions, 5 deletions
diff --git a/tests/Android.mk b/tests/Android.mk index 1531c32df..03cb154a4 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -46,7 +46,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ libSharedSystemUI LOCAL_SRC_FILES := $(call all-java-files-under, tapl) \ - ../quickstep/src/com/android/quickstep/SwipeUpSetting.java + ../quickstep/src/com/android/quickstep/SwipeUpSetting.java \ + ../src/com/android/launcher3/TestProtocol.java LOCAL_SDK_VERSION := current LOCAL_MODULE := ub-launcher-aosp-tapl diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index d64f86cbc..c3bc61bab 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -24,6 +24,8 @@ import android.support.test.uiautomator.UiObject2; import androidx.annotation.NonNull; +import com.android.launcher3.TestProtocol; + /** * Operations on AllApps opened from Home. Also a parent for All Apps opened from Overview. */ @@ -96,8 +98,8 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { } private int getScroll(UiObject2 allAppsContainer) { - return mLauncher.getAnswerFromLauncher(allAppsContainer, "TAPL_GET_SCROLL"). - getInt("scrollY", -1); + return mLauncher.getAnswerFromLauncher(allAppsContainer, TestProtocol.GET_SCROLL_MESSAGE). + getInt(TestProtocol.SCROLL_Y_FIELD, -1); } private void ensureIconVisible(UiObject2 appIcon, UiObject2 allAppsContainer) { diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index fa282c333..01e76f3f3 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -34,6 +34,7 @@ import android.support.test.uiautomator.UiObject2; import android.support.test.uiautomator.Until; import android.view.accessibility.AccessibilityEvent; +import com.android.launcher3.TestProtocol; import com.android.quickstep.SwipeUpSetting; import java.lang.ref.WeakReference; @@ -174,7 +175,7 @@ public final class LauncherInstrumentation { Bundle getAnswerFromLauncher(UiObject2 view, String requestTag) { // Send a fake set-text request to Launcher to initiate a response with requested data. - final String responseTag = requestTag + "_RESPONSE"; + final String responseTag = requestTag + TestProtocol.RESPONSE_MESSAGE_POSTFIX; return executeAndWaitForEvent( () -> view.setText(requestTag), event -> responseTag.equals(event.getClassName()), @@ -338,7 +339,7 @@ public final class LauncherInstrumentation { void swipe(int startX, int startY, int endX, int endY) { executeAndWaitForEvent( () -> mDevice.swipe(startX, startY, endX, endY, 60), - event -> "TAPL_WENT_TO_STATE".equals(event.getClassName()), + event -> TestProtocol.SWITCHED_TO_STATE_MESSAGE.equals(event.getClassName()), "Swipe failed to receive an event for the swipe end: " + startX + ", " + startY + ", " + endX + ", " + endY); } |