Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39228d03 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Improving TAPL error messages" into sc-dev

parents b9e275d2 a6cb7517
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -445,11 +445,10 @@ public final class LauncherInstrumentation {

            if (systemHealth != null) {
                return message
                        + ",\nperhaps linked to system health problems:\n<<<<<<<<<<<<<<<<<<\n"
                        + ";\nPerhaps linked to system health problems:\n<<<<<<<<<<<<<<<<<<\n"
                        + systemHealth + "\n>>>>>>>>>>>>>>>>>>";
            }
        }

        return message;
    }

@@ -460,7 +459,7 @@ public final class LauncherInstrumentation {
            if (checkEvents) {
                final String eventMismatch = eventChecker.verify(0, false);
                if (eventMismatch != null) {
                    message = message + ", having produced " + eventMismatch;
                    message = message + ";\n" + eventMismatch;
                }
            } else {
                eventChecker.finishNoWait();
@@ -497,12 +496,13 @@ public final class LauncherInstrumentation {
    private void fail(String message) {
        checkForAnomaly();
        Assert.fail(formatSystemHealthMessage(formatErrorWithEvents(
                "http://go/tapl : " + getContextDescription() + message
                        + " (visible state: " + getVisibleStateMessage() + ")", true)));
                "http://go/tapl test failure:\nOverview: " + getContextDescription()
                        + " - visible state is " + getVisibleStateMessage()
                        + ";\nDetails: " + message, true)));
    }

    private String getContextDescription() {
        return mDiagnosticContext.isEmpty() ? "" : String.join(", ", mDiagnosticContext) + "; ";
        return mDiagnosticContext.isEmpty() ? "" : String.join(", ", mDiagnosticContext);
    }

    void assertTrue(String message, boolean condition) {
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ public class LogEventChecker {
            }
        }

        return hasMismatches ? "mismatching events: " + sb.toString() : null;
        return hasMismatches ? "Mismatching events: " + sb.toString() : null;
    }

    // If the list of actual events matches the list of expected events, returns -1, otherwise