diff options
| author | 2019-06-12 04:53:47 +0000 | |
|---|---|---|
| committer | 2019-06-12 04:53:47 +0000 | |
| commit | 0f106257908cc42e763fcbbeda588cba06dda526 (patch) | |
| tree | debea4a78405f4bc250d025bc4c2fa1f144070b6 | |
| parent | e252d155b13e0f63ea4d2ff148bbb74aaf7db1da (diff) | |
| parent | e2e5ee1c3935a1ee66128a1081bedc9ec40f9012 (diff) | |
Merge "Fix crash of test after finishing RecentsAnimationTest" into qt-dev
| -rw-r--r-- | services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java index 53b0add8c37e..4986a6d5bd0d 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java +++ b/services/tests/wmtests/src/com/android/server/wm/ActivityTestsBase.java @@ -585,7 +585,10 @@ class ActivityTestsBase { } void tearDown() { - mHandlerThread.quitSafely(); + // Make sure there are no running messages and then quit the thread so the next test + // won't be affected. + mHandlerThread.getThreadHandler().runWithScissors(mHandlerThread::quit, + 0 /* timeout */); } } @@ -630,7 +633,8 @@ class ActivityTestsBase { mWindowManager = prepareMockWindowManager(); mKeyguardController = mock(KeyguardController.class); - // Do not schedule idle timeouts + // Do not schedule idle that may touch methods outside the scope of the test. + doNothing().when(this).scheduleIdleLocked(); doNothing().when(this).scheduleIdleTimeoutLocked(any()); // unit test version does not handle launch wake lock doNothing().when(this).acquireLaunchWakelock(); |