summaryrefslogtreecommitdiffstats
path: root/tests/tapl
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-04-01 13:43:46 -0700
committervadimt <vadimt@google.com>2019-04-01 13:43:46 -0700
commita734bd8d26fab7119fa29f16947e68a5cc55e3e8 (patch)
tree0bf68e0398a95d76b19e5140925d428685885814 /tests/tapl
parent09b91447467ad401e994e6e215d9a5b770dbe2c3 (diff)
downloadandroid_packages_apps_Trebuchet-a734bd8d26fab7119fa29f16947e68a5cc55e3e8.tar.gz
android_packages_apps_Trebuchet-a734bd8d26fab7119fa29f16947e68a5cc55e3e8.tar.bz2
android_packages_apps_Trebuchet-a734bd8d26fab7119fa29f16947e68a5cc55e3e8.zip
Improving TAPL diagnostics (contains changes in Launcher)
Bug: 128531133 Change-Id: Ice1ffecb39cf88afb546ceefdfca21abd879f35d
Diffstat (limited to 'tests/tapl')
-rw-r--r--tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index b71f790b8..d60c79dce 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -30,6 +30,7 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.SystemClock;
+import android.text.TextUtils;
import android.util.Log;
import android.view.InputDevice;
import android.view.MotionEvent;
@@ -225,6 +226,12 @@ public final class LauncherInstrumentation {
}
}
+ private void assertEquals(String message, String expected, String actual) {
+ if (!TextUtils.equals(expected, actual)) {
+ fail(message + " expected: '" + expected + "' but was: '" + actual + "'");
+ }
+ }
+
void assertNotEquals(String message, int unexpected, int actual) {
if (unexpected == actual) {
failEquals(message, actual);
@@ -544,8 +551,9 @@ public final class LauncherInstrumentation {
event -> TestProtocol.SWITCHED_TO_STATE_MESSAGE.equals(event.getClassName()),
"Swipe failed to receive an event for the swipe end: " + startX + ", " + startY
+ ", " + endX + ", " + endY);
- assertEquals("Swipe switched launcher to a wrong state",
- expectedState, parcel.getInt(TestProtocol.STATE_FIELD));
+ assertEquals("Swipe switched launcher to a wrong state;",
+ TestProtocol.stateOrdinalToString(expectedState),
+ TestProtocol.stateOrdinalToString(parcel.getInt(TestProtocol.STATE_FIELD)));
}
void waitForIdle() {