Files
frameworks_base/libs/WindowManager/Shell/tests
Hongwei Wang f820ea88ad 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
2020-09-02 18:13:48 +00:00
..
2020-08-20 16:13:57 -07:00
2020-08-20 16:13:57 -07:00

WM Shell Test

This contains all tests written for WM (WindowManager) Shell and it's currently divided into 3 categories

  • unittest, tests against individual functions, usually @SmallTest and do not require UI automation nor real device to run
  • integration, this maybe a mix of functional and integration tests. Contains tests verify the WM Shell as a whole, like talking to WM core. This usually involves mocking the window manager service or even talking to the real one. Due to this nature, test cases in this package is normally annotated as @LargeTest and runs with UI automation on real device
  • flicker, similar to functional tests with its sole focus on flickerness. See WM Shell Flicker Test Package for more details