Make WindowOrganizer and TaskOrganizer non-static
This is to allow unit test against TaskOrganizer, WindowOrganizer for interations between Shell and WM core. To test on WM side ``` when(mWindowOrganizer.getWindowOrganizerController()) .thenReturn(mockedWindowOrganizerController); when(mockedWindowOrganizerController.getTaskOrganizerController()) .thenReturn(mockedTaskOrganizerController) doSomeTest(); verify(mockedWindowOrganizerController).somethingHappended(); verify(mockedTaskOrganizerController).somethingHappended(); ``` To test on Shell side ``` ShellTaskOrganizer organizer = new ShellTaskOrganizer( mockedTaskOrganizerController) doSomeTest() verify(mockedTaskOrganizerController).somethingHappended(); ``` Removed also - Singleton pattern in TaskOrganizer and DisplayAreaOrganizer as it's redundant to what's in WindowOrganizer - static getController methods in both TaskOrganizer and DisplayAreaOrganizer as we prefer non-static for testability - static methods in TaskOrganizer in general - static methods in WindowManagerProxy in general Bug: 161711455 Bug: 149338177 Test: make sure everything still works Test: atest WmTests:WindowOrganizerTests \ WmTests:DisplayAreaOrganizerTest Change-Id: I978d20c7b87e73d0f6d22f7ab08188e4d12d745c
Loading
Please register or sign in to comment