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

Commit 6a0754a9 authored by Bryce Lee's avatar Bryce Lee
Browse files

Do not depend on actual WindowManagerService object.

The Activity unit tests do not need a real instance of
WindowManagerService and can instead use a mock.

Test: bit FrameworksServicesTests:com.android.server.am.ActivityRecordTests
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStarterTests
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests
Test: bit FrameworksServicesTests:com.android.server.am.ActivityStackTests

Bug: 67629551
Change-Id: I2ab681eb88ebfa7113838dab19a3a1c017132955
parent 7472b72d
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -55,10 +55,6 @@ public class ActivityTestsBase {
    private final Context mContext = InstrumentationRegistry.getContext();
    private HandlerThread mHandlerThread;

    // Grabbing an instance of {@link WindowManagerService} creates it if not present so this must
    // be called at before any tests.
    private final WindowManagerService mWms = WindowTestUtils.getWindowManagerService(mContext);

    @Before
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
@@ -136,7 +132,7 @@ public class ActivityTestsBase {
            mSupportsSplitScreenMultiWindow = true;
            mSupportsFreeformWindowManagement = true;
            mSupportsPictureInPicture = true;
            mWindowManager = WindowTestUtils.getWindowManagerService(context);
            mWindowManager = WindowTestUtils.getMockWindowManagerService();
        }

        @Override