diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 68b0a36049..d85f6303d9 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -711,7 +711,7 @@ public final class LauncherInstrumentation { final LogEventChecker eventChecker = mEventChecker; mEventChecker = null; if (checkEvents) { - final String eventMismatch = eventChecker.verify(0, false); + final String eventMismatch = eventChecker.verify(0); if (eventMismatch != null) { message = message + ";\n" + eventMismatch; } @@ -2408,7 +2408,7 @@ public final class LauncherInstrumentation { if (mEventChecker != null) { mEventChecker = null; if (mCheckEventsForSuccessfulGestures) { - final String message = eventChecker.verify(WAIT_TIME_MS, true); + final String message = eventChecker.verify(WAIT_TIME_MS); if (message != null) { dumpDiagnostics(message); checkForAnomaly(); diff --git a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java index 672c6e0c8c..055a357049 100644 --- a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java +++ b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java @@ -15,10 +15,6 @@ */ package com.android.launcher3.tapl; -import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_MAIN; -import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_PILFER; -import static com.android.launcher3.testing.shared.TestProtocol.SEQUENCE_TIS; - import android.os.SystemClock; import com.android.launcher3.testing.shared.TestProtocol; @@ -87,25 +83,11 @@ public class LogEventChecker { mLauncher.getTestInfo(TestProtocol.REQUEST_STOP_EVENT_LOGGING); } - String verify(long waitForExpectedCountMs, boolean successfulGesture) { + String verify(long waitForExpectedCountMs) { final ListMap actualEvents = finishSync(waitForExpectedCountMs); if (actualEvents == null) return "null event sequences because launcher likely died"; - final String lowLevelDiags = lowLevelMismatchDiagnostics(actualEvents); - // If we have a sequence mismatch for a successful gesture, we want to provide all low-level - // details. - if (successfulGesture) { - return lowLevelDiags; - } - - final String sequenceMismatchInEnglish = highLevelMismatchDiagnostics(actualEvents); - - if (sequenceMismatchInEnglish != null) { - LauncherInstrumentation.log(lowLevelDiags); - return "Hint: " + sequenceMismatchInEnglish; - } else { - return lowLevelDiags; - } + return lowLevelMismatchDiagnostics(actualEvents); } private String lowLevelMismatchDiagnostics(ListMap actualEvents) { @@ -140,42 +122,6 @@ public class LogEventChecker { return hasMismatches ? "Mismatching events: " + sb.toString() : null; } - private String highLevelMismatchDiagnostics(ListMap actualEvents) { - if (!mExpectedEvents.getNonNull(SEQUENCE_TIS).isEmpty() - && actualEvents.getNonNull(SEQUENCE_TIS).isEmpty()) { - return "TouchInteractionService didn't receive any of the touch events sent by the " - + "test"; - } - if (getMismatchPosition(mExpectedEvents.getNonNull(SEQUENCE_TIS), - actualEvents.getNonNull(SEQUENCE_TIS)) != -1) { - // If TIS has a mismatch that we can't convert to high-level diags, don't convert - // other sequences either. - return null; - } - - if (mExpectedEvents.getNonNull(SEQUENCE_PILFER).size() == 1 - && actualEvents.getNonNull(SEQUENCE_PILFER).isEmpty()) { - return "Launcher didn't detect the navigation gesture sent by the test"; - } - if (mExpectedEvents.getNonNull(SEQUENCE_PILFER).isEmpty() - && actualEvents.getNonNull(SEQUENCE_PILFER).size() == 1) { - return "Launcher detected a navigation gesture, but the test didn't send one"; - } - if (getMismatchPosition(mExpectedEvents.getNonNull(SEQUENCE_PILFER), - actualEvents.getNonNull(SEQUENCE_PILFER)) != -1) { - // If Pilfer has a mismatch that we can't convert to high-level diags, don't analyze - // other sequences. - return null; - } - - if (!mExpectedEvents.getNonNull(SEQUENCE_MAIN).isEmpty() - && actualEvents.getNonNull(SEQUENCE_MAIN).isEmpty()) { - return "None of the touch or keyboard events sent by the test was received by " - + "Launcher's main thread"; - } - return null; - } - // If the list of actual events matches the list of expected events, returns -1, otherwise // the position of the mismatch. private static int getMismatchPosition(List expected, List actual) {