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

Commit 009d050e authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Resize display to portrait for some wm unit tests" into main

parents 78848f41 91d6b527
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -353,6 +353,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {

    @Test
    public void testRecentViewInFixedPortraitWhenTopAppInLandscape() {
        makeDisplayPortrait(mDefaultDisplay);
        unblockDisplayRotation(mDefaultDisplay);
        mWm.setRecentsAnimationController(mController);

@@ -488,6 +489,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {

    @Test
    public void testWallpaperHasFixedRotationApplied() {
        makeDisplayPortrait(mDefaultDisplay);
        unblockDisplayRotation(mDefaultDisplay);
        mWm.setRecentsAnimationController(mController);

+1 −4
Original line number Diff line number Diff line
@@ -116,10 +116,7 @@ public class WallpaperControllerTests extends WindowTestsBase {
    public void testWallpaperSizeWithFixedTransform() {
        // No wallpaper
        final DisplayContent dc = mDisplayContent;
        if (dc.mBaseDisplayHeight <= dc.mBaseDisplayWidth) {
            // Make sure the display size is portrait.
            resizeDisplay(dc, 500, 1000);
        }
        makeDisplayPortrait(dc);

        // No wallpaper WSA Surface
        final WindowState wallpaperWindow = createWallpaperWindow(dc);
+7 −0
Original line number Diff line number Diff line
@@ -977,6 +977,13 @@ class WindowTestsBase extends SystemServiceTestsBase {
        displayContent.onRequestedOverrideConfigurationChanged(c);
    }

    /** Used for the tests that assume the display is portrait by default. */
    static void makeDisplayPortrait(DisplayContent displayContent) {
        if (displayContent.mBaseDisplayHeight <= displayContent.mBaseDisplayWidth) {
            resizeDisplay(displayContent, 500, 1000);
        }
    }

    // The window definition for UseTestDisplay#addWindows. The test can declare to add only
    // necessary windows, that avoids adding unnecessary overhead of unused windows.
    static final int W_NOTIFICATION_SHADE = TYPE_NOTIFICATION_SHADE;