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

Commit 3f87ea1a authored by chihtinglo's avatar chihtinglo
Browse files

Fix failing test enableWindowMagnificationWithScaleOne_enabled_AnimationAndInvokeCallback

The test fails since the magnifier will exceed the boundary with the
targeted X,Y center. Fixing the failure with always moving the magnifier
to the top left corner, within the boundary.

Bug: 306201035
Flag: N/A
Test: atest SystemUITests:WindowMagnificationAnimationControllerTest
Change-Id: If96eb33d86c50e992f1da480ec78137b3b04c714
parent e619e972
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -241,9 +241,13 @@ public class WindowMagnificationAnimationControllerTest extends SysuiTestCase {
            throws RemoteException {
        enableWindowMagnificationWithoutAnimation();

        // Wait for Rects updated.
        waitForIdleSync();
        View mirrorView = mWindowManager.getAttachedView();
        final float targetScale = 1.0f;
        final float targetCenterX = DEFAULT_CENTER_X + 100;
        final float targetCenterY = DEFAULT_CENTER_Y + 100;
        // Move the magnifier to the top left corner, within the boundary
        final float targetCenterX = mirrorView.getWidth() / 2.0f;
        final float targetCenterY = mirrorView.getHeight() / 2.0f;

        Mockito.reset(mSpyController);
        mInstrumentation.runOnMainSync(() -> {