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

Commit 6829077d authored by wilsonshih's avatar wilsonshih
Browse files

Do not invoke JankMonitor for unit test.

Test can be finished before FrameTracker begin, the fake SurfaceControl
may already removed.

Bug: 333917731
Test: atest BackAnimationControllerTest
Change-Id: I3ae00c407788021d52e47ae35568686a92ba72dc
parent 2813aebe
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.view.RemoteAnimationTarget;
import android.window.IBackAnimationRunner;
import android.window.IOnBackInvokedCallback;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.jank.Cuj.CujType;
import com.android.wm.shell.common.InteractionJankMonitorUtils;

@@ -108,7 +109,8 @@ public class BackAnimationRunner {
        }
    }

    private boolean shouldMonitorCUJ(RemoteAnimationTarget[] apps) {
    @VisibleForTesting
    boolean shouldMonitorCUJ(RemoteAnimationTarget[] apps) {
        return apps.length > 0 && mCujType != NO_CUJ;
    }

+1 −0
Original line number Diff line number Diff line
@@ -596,6 +596,7 @@ public class BackAnimationControllerTest extends ShellTestCase {

        // Set up the monitoring objects.
        doNothing().when(runner).onAnimationStart(anyInt(), any(), any(), any(), any());
        doReturn(false).when(animationRunner).shouldMonitorCUJ(any());
        doReturn(runner).when(animationRunner).getRunner();
        doReturn(callback).when(animationRunner).getCallback();