Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d0dc576 authored by Felix Stern's avatar Felix Stern
Browse files

Fix test: Do not assert that currentInputStarted flag is set after hiding the IME

The test method verifyInputViewStatusInternal always expected IMS#getCurrentInputStarted() to return true, after the IME was requested to be hidden. This is no longer valid as hiding the IME resets that flag (IMS#doFinishInput).

Test: InputMethodServiceTest#testShowHideKeyboard_byUserAction
Fix: 374069996
Flag: android.view.inputmethod.refactor_insets_controller
Change-Id: Ie01f568e6625d3df0ea08dfe68152f6aa864bc10
parent 7875655e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -159,15 +159,16 @@ public class InputMethodServiceTest {

        // Press home key to hide soft keyboard.
        Log.i(TAG, "Press home");
        verifyInputViewStatus(
                () -> assertThat(mUiDevice.pressHome()).isTrue(),
                true /* expected */,
                false /* inputViewStarted */);
        if (Flags.refactorInsetsController()) {
            assertThat(mUiDevice.pressHome()).isTrue();
            // The IME visibility is only sent at the end of the animation. Therefore, we have to
            // wait until the visibility was sent to the server and the IME window hidden.
            eventually(() -> assertThat(mInputMethodService.isInputViewShown()).isFalse());
        } else {
            verifyInputViewStatus(
                    () -> assertThat(mUiDevice.pressHome()).isTrue(),
                    true /* expected */,
                    false /* inputViewStarted */);
            assertThat(mInputMethodService.isInputViewShown()).isFalse();
        }
    }