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

Commit 8e8a1b87 authored by Chris Li's avatar Chris Li
Browse files

Fix DisplayAreaGroupTest

Before, setBounds doesn't really change the display orientation, it will
be reset to the actual bounds within the display rotation, so the test
passes only on device that is currently in portrait. Now, rotate the
display to portrait first.

Fix: 295865337
Test: atest WmTests:DisplayAreaGroupTest
Change-Id: I9e2338909c726135be08dc4313362df35e67ac30
parent ac6b6e99
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -114,8 +114,9 @@ public class DisplayAreaGroupTest extends WindowTestsBase {

    @Test
    public void testResolveOverrideConfiguration_reverseOrientationWhenDifferentFromParentRoot() {
        mDisplayContent.setBounds(0, 0, 600, 900);
        mDisplayContent.updateOrientation();
        // Rotate the display to portrait.
        final DisplayRotation displayRotation = mDisplayContent.getDisplayRotation();
        displayRotation.setRotation(displayRotation.getPortraitRotation());
        mDisplayContent.sendNewConfiguration();

        // DAG fills Display
@@ -128,7 +129,7 @@ public class DisplayAreaGroupTest extends WindowTestsBase {
        assertThat(mDisplayAreaGroup.getConfiguration().orientation)
                .isEqualTo(ORIENTATION_LANDSCAPE);

        // DisplayAreaGroup is portriat, same as Display
        // DisplayAreaGroup is portrait, same as Display
        mDisplayAreaGroup.setBounds(0, 0, 300, 450);

        assertThat(mDisplayAreaGroup.getConfiguration().orientation)