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

Commit e7e752e0 authored by Schneider Victor-Tulias's avatar Schneider Victor-Tulias
Browse files

Fix test failures in AbsSwipeUpHandlerTestCase

AbsSwipeUpHandlerTestCase caused test failures when running locally on device.

Flag: EXEMPT testing fix
Bug: 371020209
Test: AbsSwipeUpHandlerTestCase
Change-Id: I7b47b5642223e81c6bb9991a7ff271ba8ffff0ba
parent bad63261
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -80,8 +80,6 @@ public abstract class AbsSwipeUpHandlerTestCase<

    protected final Context mContext =
            InstrumentationRegistry.getInstrumentation().getTargetContext();
    protected final RecentsAnimationDeviceState mRecentsAnimationDeviceState =
            new RecentsAnimationDeviceState(mContext, true);
    protected final InputConsumerController mInputConsumerController =
            InputConsumerController.getRecentsAnimationInputConsumer();
    protected final ActivityManager.RunningTaskInfo mRunningTaskInfo =
@@ -114,6 +112,7 @@ public abstract class AbsSwipeUpHandlerTestCase<
            new Bundle());

    protected TaskAnimationManager mTaskAnimationManager;
    protected RecentsAnimationDeviceState mRecentsAnimationDeviceState;

    @Mock protected CONTAINER_INTERFACE mActivityInterface;
    @Mock protected ContextInitListener<?> mContextInitListener;
@@ -176,6 +175,12 @@ public abstract class AbsSwipeUpHandlerTestCase<
        }).when(recentsContainer).runOnBindToTouchInteractionService(any());
    }

    @Before
    public void setUpRecentsAnimationDeviceState() {
        runOnMainSync(() ->
                mRecentsAnimationDeviceState = new RecentsAnimationDeviceState(mContext, true));
    }

    @Test
    public void testInitWhenReady_registersActivityInitListener() {
        String reasonString = "because i said so";
@@ -306,8 +311,6 @@ public abstract class AbsSwipeUpHandlerTestCase<
    }

    private void onRecentsAnimationStart(SWIPE_HANDLER absSwipeUpHandler) {
        when(mActivityInterface.getOverviewWindowBounds(any(), any())).thenReturn(new Rect());

        runOnMainSync(() -> absSwipeUpHandler.onRecentsAnimationStart(
                mRecentsAnimationController, mRecentsAnimationTargets));
    }