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

Commit 771da0c0 authored by vadimt's avatar vadimt
Browse files

Improving diags for launching an app.

Test: presubmit
Bug: 187761685
Change-Id: I8c304dbabc474e39aa8fe1cca234140823764099
parent d6e33dc3
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.