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

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

Merge "Improving diags for launching an app." into sc-v2-dev

parents 8aac1952 771da0c0
Loading
Loading
Loading
Loading
+23 −18
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ abstract class Launchable {
    protected abstract String launchableType();

    private Background launch(BySelector selector) {
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                "want to launch an app from " + launchableType())) {
            LauncherInstrumentation.log("Launchable.launch before click "
                    + mObject.getVisibleCenter() + " in " + mLauncher.getVisibleBounds(mObject));
            final String label = mObject.getText();
@@ -69,12 +71,15 @@ abstract class Launchable {
                    () -> "Launching an app didn't open a new window: " + label,
                    "clicking " + launchableType());

            try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("clicked")) {
                mLauncher.assertTrue(
                        "App didn't start: " + label + " (" + selector + ")",
                        TestHelpers.wait(Until.hasObject(selector),
                                LauncherInstrumentation.WAIT_TIME_MS));
                return new Background(mLauncher);
            }
        }
    }

    /**
     * Drags an object to the center of homescreen.