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

Commit d833bce1 authored by Hiroki Sato's avatar Hiroki Sato
Browse files

Fix parameters in FullScreenMagnificationGestureHandlerTest

The singature of FullScreenMagnificationController#setScaleAndCenter is
(int displayId, float scale, float centerX, float centerY, ...), but
some test calls it with wrong arguments.
This fixes it.

Bug: 354696546
Test: FullScreenMagnificationGestureHandlerTest (with I482c121cbc0d1da64e6d22aabcc3894caf89bb18)
Flag: EXEMPT bugfix
Change-Id: Ic4a32853bae545650f9d0f9a5c908ba05443dd7d
parent fba79d86
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1434,7 +1434,7 @@ public class FullScreenMagnificationGestureHandlerTest {
                (INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.height()) / 2.0f;
        float scale = 5.6f; // value is unimportant but unique among tests to increase coverage.
        mFullScreenMagnificationController.setScaleAndCenter(
                DISPLAY_0, centerX, centerY, scale, true, /* animate= */ false, 1);
                DISPLAY_0, scale, centerX, centerY, true, /* animate= */ false, 1);
        centerX = mFullScreenMagnificationController.getCenterX(DISPLAY_0);
        centerY = mFullScreenMagnificationController.getCenterY(DISPLAY_0);

@@ -1507,7 +1507,7 @@ public class FullScreenMagnificationGestureHandlerTest {
                (INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.height()) / 2.0f;
        float scale = 6.2f; // value is unimportant but unique among tests to increase coverage.
        mFullScreenMagnificationController.setScaleAndCenter(
                DISPLAY_0, centerX, centerY, scale, true, /* animate= */ false, 1);
                DISPLAY_0, scale, centerX, centerY, true, /* animate= */ false, 1);
        MotionEvent event = mouseEvent(centerX, centerY, ACTION_HOVER_MOVE);
        send(event, InputDevice.SOURCE_MOUSE);
        fastForward(20);
@@ -1548,7 +1548,7 @@ public class FullScreenMagnificationGestureHandlerTest {
                (INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.height()) / 2.0f;
        float scale = 4.0f; // value is unimportant but unique among tests to increase coverage.
        mFullScreenMagnificationController.setScaleAndCenter(
                DISPLAY_0, centerX, centerY, scale, true, /* animate= */ false, 1);
                DISPLAY_0, scale, centerX, centerY, true, /* animate= */ false, 1);

        // HOVER_MOVE should change magnifier viewport.
        MotionEvent event = motionEvent(centerX + 20, centerY, ACTION_HOVER_MOVE);
@@ -1592,7 +1592,7 @@ public class FullScreenMagnificationGestureHandlerTest {
                (INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.height()) / 2.0f;
        float scale = 5.3f; // value is unimportant but unique among tests to increase coverage.
        mFullScreenMagnificationController.setScaleAndCenter(
                DISPLAY_0, centerX, centerY, scale, true, /* animate= */ false, 1);
                DISPLAY_0, scale, centerX, centerY, true, /* animate= */ false, 1);
        MotionEvent event = motionEvent(centerX, centerY, ACTION_HOVER_MOVE);
        send(event, source);
        fastForward(20);
@@ -1626,7 +1626,7 @@ public class FullScreenMagnificationGestureHandlerTest {
                (INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.height()) / 2.0f;
        float scale = 2.7f; // value is unimportant but unique among tests to increase coverage.
        mFullScreenMagnificationController.setScaleAndCenter(
                DISPLAY_0, centerX, centerY, scale, true, /* animate= */ false, 1);
                DISPLAY_0, scale, centerX, centerY, true, /* animate= */ false, 1);
        MotionEvent event = motionEvent(centerX, centerY, ACTION_HOVER_MOVE);
        send(event, source);
        fastForward(20);
@@ -1662,7 +1662,7 @@ public class FullScreenMagnificationGestureHandlerTest {
                (INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.height()) / 2.0f;
        float scale = 3.8f; // value is unimportant but unique among tests to increase coverage.
        mFullScreenMagnificationController.setScaleAndCenter(
                DISPLAY_0, centerX, centerY, scale, true, /* animate= */ false, 1);
                DISPLAY_0, scale, centerX, centerY, true, /* animate= */ false, 1);
        centerX = mFullScreenMagnificationController.getCenterX(DISPLAY_0);
        centerY = mFullScreenMagnificationController.getCenterY(DISPLAY_0);

@@ -1699,7 +1699,7 @@ public class FullScreenMagnificationGestureHandlerTest {
                (INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.height()) / 2.0f;
        float scale = 4.0f; // value is unimportant but unique among tests to increase coverage.
        mFullScreenMagnificationController.setScaleAndCenter(
                DISPLAY_0, centerX, centerY, scale, true, /* animate= */ false, 1);
                DISPLAY_0, scale, centerX, centerY, true, /* animate= */ false, 1);
        centerX = mFullScreenMagnificationController.getCenterX(DISPLAY_0);
        centerY = mFullScreenMagnificationController.getCenterY(DISPLAY_0);