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

Commit 2e81f200 authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Add unit test for SCM upscaling with display move

Flag: com.android.window.flags.enable_upscaling_size_compat_on_exiting_desktop_bugfix
Bug: 432329483
Test: SizeCompatTests#testUpscaling_boundsUpscaledWithDisplayMove
Change-Id: I7cd9195ee23df686e6d0f5c46e51945e2460c6fd
parent 40a5b3ea
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() {