commit | 22fb8ef1fbfd9b8662f79fa15d2d1223705c7b5f | [log] [tgz] |
---|---|---|
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | Tue Mar 19 16:43:57 2024 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Tue Mar 19 16:43:57 2024 +0000 |
tree | a6988fdfd0728f3346971af29684e68369183445 | |
parent | 69728b0f93c6feb351214b380380213ffdba3ae7 [diff] | |
parent | 3f719b76bc2600ef96c3e7b1d51606556fe5d40e [diff] |
Merge "Changed mocking function due to WrongTypeOfReturnValue exception" into main
diff --git a/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceWindowGainedFocusTest.java b/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceWindowGainedFocusTest.java index cea65b5..9f46d0ba 100644 --- a/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceWindowGainedFocusTest.java +++ b/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceWindowGainedFocusTest.java
@@ -198,7 +198,9 @@ @Test public void startInputOrWindowGainedFocus_userNotRunning() throws RemoteException { - when(mMockUserManagerInternal.isUserRunning(anyInt())).thenReturn(false); + // Run blockingly on ServiceThread to avoid that interfering with our stubbing. + mServiceThread.getThreadHandler().runWithScissors( + () -> when(mMockUserManagerInternal.isUserRunning(anyInt())).thenReturn(false), 0); assertThat( startInputOrWindowGainedFocus(