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

Commit c116cee7 authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Further tightening leak detector checks

Some checks see 2 activities for some reason: Launcher and Overview.
Both active.
I'll have to decide what to do with these cases, but for now, I simply don't pass 'true' from places where this can happen.

When we have 2 activities:
Either Overview is present (and I guess we have to close it before the check) or the screenshot shows that there is no Overview, but internally, apparently, Overview activity is active and therefore, technically, is not leaked.
For the latter case, I may need to do some kind of investigation.
But for now, I'm tightening the check where there is no Overview.

Bug: 187761685
Test: presubmit
Flag: N/A
Change-Id: I1f1619093e0948b8112f29fd7e94facbf7093983
parent 769fa534
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,6 +95,6 @@ public class AbstractTaplTestsTaskbar extends AbstractQuickStepTest {
        launcher.enableTransientTaskbar(expectTransientTaskbar);
        launcher.recreateTaskbar();
        launcher.checkForAnomaly(true, true);
        AbstractLauncherUiTest.checkDetectedLeaks(launcher);
        AbstractLauncherUiTest.checkDetectedLeaks(launcher, true);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ public class FallbackRecentsTest {
    public void tearDown() {
        try {
            // Limits UI tests affecting tests running after them.
            AbstractQuickStepTest.checkDetectedLeaks(mLauncher);
            AbstractQuickStepTest.checkDetectedLeaks(mLauncher, true);
        } finally {
            mLauncher.onTestFinish();
        }
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ public class NavigationModeSwitchRule implements TestRule {
                        + launcher.getNavigationModeMismatchError(false),
                () -> launcher.getNavigationModeMismatchError(false) == null,
                WAIT_TIME_MS, launcher);
        AbstractLauncherUiTest.checkDetectedLeaks(launcher);
        AbstractLauncherUiTest.checkDetectedLeaks(launcher, true);
        return true;
    }

+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ public class TaskbarModeSwitchRule implements TestRule {
        assertTrue(launcher, "Couldn't set taskbar=" + expectTransientTaskbar,
                isTaskbarTransientMode(context) == expectTransientTaskbar, description);

        AbstractLauncherUiTest.checkDetectedLeaks(launcher);
        AbstractLauncherUiTest.checkDetectedLeaks(launcher, true);
    }

    private static void assertTrue(LauncherInstrumentation launcher, String message,
+2 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public class PortraitLandscapeRunner implements TestRule {
            private void evaluateInPortrait() throws Throwable {
                mTest.mDevice.setOrientationNatural();
                mTest.mLauncher.setExpectedRotation(Surface.ROTATION_0);
                AbstractLauncherUiTest.checkDetectedLeaks(mTest.mLauncher);
                AbstractLauncherUiTest.checkDetectedLeaks(mTest.mLauncher, true);
                base.evaluate();
                mTest.getDevice().pressHome();
            }
@@ -82,7 +82,7 @@ public class PortraitLandscapeRunner implements TestRule {
            private void evaluateInLandscape() throws Throwable {
                mTest.mDevice.setOrientationLeft();
                mTest.mLauncher.setExpectedRotation(Surface.ROTATION_90);
                AbstractLauncherUiTest.checkDetectedLeaks(mTest.mLauncher);
                AbstractLauncherUiTest.checkDetectedLeaks(mTest.mLauncher, true);
                base.evaluate();
                mTest.getDevice().pressHome();
            }