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

Commit d4ef3010 authored by Yunfan Chen's avatar Yunfan Chen Committed by Wale Ogunwale
Browse files

Fix WM Tests Failures

The test ATM mWindowManager was not correctly set. This should be able
to fix the tests failures currently on master.

Test: atest WmTests FrameworksServicesTests:com.android.server.wm
Test: presubmit
Change-Id: I657e76e5b5e2f41e3141b33cf619655807062f98
parent afd7c690
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1105,6 +1105,8 @@ final class ActivityRecord extends ConfigurationContainer {
    }

    void removeWindowContainer() {
        if (service.mWindowManager.mRoot == null) return;

        final DisplayContent dc = service.mWindowManager.mRoot.getDisplayContent(
                getDisplayId());
        if (dc == null) {
+2 −1
Original line number Diff line number Diff line
@@ -233,7 +233,9 @@ class ActivityTestsBase {
                    aInfo /*aInfo*/, new Configuration(), null /* resultTo */, null /* resultWho */,
                    0 /* reqCode */, false /*componentSpecified*/, false /* rootVoiceInteraction */,
                    mService.mStackSupervisor, null /* options */, null /* sourceRecord */);
            spyOn(activity);
            activity.mAppWindowToken = mock(AppWindowToken.class);
            doNothing().when(activity).removeWindowContainer();

            if (mTaskRecord != null) {
                mTaskRecord.addActivityToTop(activity);
@@ -245,7 +247,6 @@ class ActivityTestsBase {
                    mock(WindowProcessListener.class));
            wpc.setThread(mock(IApplicationThread.class));
            activity.setProcess(wpc);
            activity.service.mWindowManager.mRoot = mock(RootWindowContainer.class);
            return activity;
        }
    }