Merge "Fix crash of test after finishing RecentsAnimationTest" into qt-dev

am: 0f10625790

Change-Id: I778a01b86398718c7180b89d915c8c7d81e48e3e
This commit is contained in:
Riddle Hsu
2019-06-11 22:02:31 -07:00
committed by android-build-merger

View File

@@ -585,7 +585,10 @@ class ActivityTestsBase {
} }
void tearDown() { 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(); mWindowManager = prepareMockWindowManager();
mKeyguardController = mock(KeyguardController.class); 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()); doNothing().when(this).scheduleIdleTimeoutLocked(any());
// unit test version does not handle launch wake lock // unit test version does not handle launch wake lock
doNothing().when(this).acquireLaunchWakelock(); doNothing().when(this).acquireLaunchWakelock();