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

Commit cf786c01 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

Fix wm test rule to rethrow exceptions and update StubTransaction

Test: presubmit
Test: atest WmTests:SystemServicesTestRuleTest
Change-Id: I412093ea0e7fcbe47c2f33d0588c26626ea01b65
parent 5a99280c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@ public class AppWindowTokenTests extends WindowTestsBase {
    }

    @Test
    @FlakyTest(bugId = 149760957)
    public void testSizeCompatBounds() {
        // Disable the real configuration resolving because we only simulate partial flow.
        // TODO: Have test use full flow.
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ import static java.util.stream.Collectors.toList;
import android.platform.test.annotations.Presubmit;
import android.view.SurfaceControl;

import androidx.test.filters.FlakyTest;

import org.hamcrest.CustomTypeSafeMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
@@ -65,6 +67,7 @@ public class DisplayAreaPolicyBuilderTest {
    private TestWindowManagerPolicy mPolicy = new TestWindowManagerPolicy(null, null);

    @Test
    @FlakyTest(bugId = 149760939)
    public void testBuilder() {
        WindowManagerService wms = mSystemServices.getWindowManagerService();
        DisplayArea.Root root = new SurfacelessDisplayAreaRoot(wms);
+2 −0
Original line number Diff line number Diff line
@@ -599,6 +599,7 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase {
    }

    @Test
    @FlakyTest(bugId = 149760800)
    public void layoutWindowLw_withLongEdgeDisplayCutout() {
        addLongEdgeDisplayCutout();

@@ -618,6 +619,7 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase {
    }

    @Test
    @FlakyTest(bugId = 149760800)
    public void layoutWindowLw_withLongEdgeDisplayCutout_never() {
        addLongEdgeDisplayCutout();

+5 −0
Original line number Diff line number Diff line
@@ -255,4 +255,9 @@ public class StubTransaction extends SurfaceControl.Transaction {
            int priority) {
        return this;
    }

    @Override
    public SurfaceControl.Transaction unsetColor(SurfaceControl sc) {
        return this;
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ public class SystemServicesTestRule implements TestRule {
                        }
                        throw t;
                    }
                    if (throwable != null) throw throwable;
                }
            }
        };
Loading