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

Commit 50f90eda authored by Kazuki Takise's avatar Kazuki Takise Committed by Android (Google) Code Review
Browse files

Merge "Add unit test for SCM upscaling with display move" into main

parents 6ebbf65b 2e81f200
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -4661,6 +4661,30 @@ public class SizeCompatTests extends WindowTestsBase {
        assertUpScaled();
    }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_UPSCALING_SIZE_COMPAT_ON_EXITING_DESKTOP_BUGFIX)
    public void testUpscaling_boundsUpscaledWithDisplayMove() {
        final int dw = 1000;
        final int dh = 600;
        final DisplayContent display = new TestDisplayContent.Builder(mAtm, dw, dh).build();
        setUpApp(display);
        prepareUnresizable(mActivity, SCREEN_ORIENTATION_PORTRAIT);
        assertEquals(WindowConfiguration.WINDOWING_MODE_FULLSCREEN, mTask.getWindowingMode());
        assertFitted();

        final DisplayInfo displayInfo = new DisplayInfo();
        displayInfo.copyFrom(mDisplayInfo);
        displayInfo.type = TYPE_EXTERNAL;
        displayInfo.logicalWidth = dw * 2;
        displayInfo.logicalHeight = dh * 2;
        final DisplayContent biggerExternalDisplay =
                new TestDisplayContent.Builder(mAtm, displayInfo).build();
        mActivity.mRootWindowContainer.moveRootTaskToDisplay(mTask.mTaskId,
                biggerExternalDisplay.mDisplayId, true /* onTop */);
        mActivity.onConfigurationChanged(mTask.getConfiguration());
        assertUpScaled();
    }

    @Test
    @EnableFlags(Flags.FLAG_IGNORE_ASPECT_RATIO_RESTRICTIONS_FOR_RESIZEABLE_FREEFORM_ACTIVITIES)
    public void testUserAspectRatioOverridesNotAppliedToResizeableFreeformActivity() {