summaryrefslogtreecommitdiff
path: root/tests/InputMethodStressTest/src
AgeCommit message (Collapse)Author
2024-07-16Update UiAutomator imports Cosmin Băieș
This updates the import of UiAutomator from the deprecated ones. Flag: TEST_ONLY Test: atest Bug: 353528639 Bug: 235842600 Change-Id: I5a4dba5b87817a2c351ab2acfe2ac889b87e995c
2024-04-27Fix IME TestActivities for edge-to-edge Cosmin Băieș
This fixes the IME test activities to properly handle being displayed in edge-to-edge mode. Fix: 309578419 Test: atest AutoShowTest ImeOpenCloseStressTest DefaultImeVisibilityTest Change-Id: I42d93071c7465c9bc41be92c0ddddfa55a0bb1a3
2023-08-23Merge "Improve InputMethodStressTest annotations" into udc-qpr-dev am: ↵ Cosmin Băieș
a24ef11c9f am: 43edae4600 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24148884 Change-Id: I91249fab2e48a0fa0c72388faf6ec8f365a7be77 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-22Improve InputMethodStressTest annotations Cosmin Băieș
Extract methods for requesting IME focus on the view, on the main thread, and asserting the request is successful. Update assertion messages to be more explicit about the expected outcome, and the value being asserted on. Bug: 292086579 Test: atest InputMethodStressTest Change-Id: I40fce41cb890349877cf1384d883599d15093378
2023-08-21Merge "Ensure waitOnMainUntil runs on the main thread" into udc-qpr-dev am: ↵ Cosmin Băieș
08497eca4a am: 024ede0229 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24464970 Change-Id: Id3c218b3e1e061c16fb03fa4b09b8279470c84bb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-17Ensure waitOnMainUntil runs on the main thread Cosmin Băieș
Test: n/a Bug: 296390700 Change-Id: I1c0a024ef6e645e6f3d9b2b041879455903be533
2023-07-20Merge changes from topic ↵ Cosmin Băieș
"revert-24042550-revert-23844944-ime_implicit_explicit_fix-VSYYMXMNII-GLIKJUHZWS" into udc-qpr-dev am: a5fa0bed6e am: b4a37db4ea Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24130484 Change-Id: I282d7fc5c1d07e463cbe13607ae732717fcc3994 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-19Fix initial iteration in DefaultImeVisibilityTest Cosmin Băieș
Ensure rotation is successfully applied before starting the stress test iterations, as this would previously lead to the first iteration of the landscape test still being in portrait mode, and incorrectly passing the assertions. Test: atest DefaultImeVisibilityTest Bug: 291742721 Change-Id: Iae068a92601d6dc632f10373ab6ab4bd41dd742d
2023-07-19Revert^2 "Fix SHOW_IMPLICIT and SHOW_EXPLICIT handling" Cosmin Băieș
cf811952ad8c693ef49081ed491b5615d34b9e9d Re-submitting original CL as the issue has been fixed by setting the correct (SHOW_EXPLICIT) flag for the InputMethodStressTest suite. Original CL: Fix SHOW_IMPLICIT and SHOW_EXPLICIT handling This fixes a bug introduced in the refactor from [1], where SHOW_IMPLICIT and SHOW_EXPLICIT requests would not be handled correctly, as they represent the same underlying bit flag value. IntDefs were added to help understand which set of flags to use based on call site. Requests originating from InputMethodManager (and a few from InputMethodService) must utilise InputMethodManager flags (i.e SHOW_IMPLICIT). When reaching the ImeVisibilityStateComputer, these are translated to InputMethodService flags (i.e. SHOW_EXPLICIT). Additonally, this documents and tests that `ImeVisibilityStateComputer` keeps the strongest state set until a hide request (i.e. an implicit show request just after a forced / explicit show request, without any hide requests in between, will still have the forced / explicit state set). [1]: Id1115ceb951e4bb0361a32b824d966cc70b7d132 Bug: 289188559 Test: atest DefaultImeVisibilityApplierTest DefaultImeVisibilityTest ImeVisibilityStateComputerTest com.android.inputmethodservice.InputMethodServiceTest Change-Id: I2117053c5a45253b9537f903a1ac6b3c8bef69af
2023-07-04Merge "Skip notification test on Wear." Jinyi Shan
2023-06-01Merge "Remove check for result of IMM#showSoftInput and hideSoftInput" into ↵ Ziqi Chen
udc-dev
2023-05-27Fix rotation test on tablets czq
Although we set "android:configChanges="orientation|screenSize" for TestActivity, it is still recreated after rotation on tablets. After recreation, the old activity and EditText view are dropped, which causes the test failures. Fix this by: 1. Remove android:configChanges to trigger recreation at all devices 2. Record the last created instance of TestActivity to get the new activity 3. Verify the show/hide behavior for the new acitivity. Note that the keyboard will not show after activity recreation only when visibility flag is SOFT_INPUT_STATE_ALWAYS_HIDDEN. Bug: 275666243 Test: atest com.android.inputmethod.stresstest.ImeOpenCloseStressTest#testRotateScreenWithKeyboardOn Change-Id: I113c0b1376febed5cb6dace9cd0467339f77c699
2023-05-22Remove check for result of IMM#showSoftInput and hideSoftInput czq
Bug: 280141638 Test: atest com.android.inputmethod.stresstest.DefaultImeVisibilityTest#showHideDefaultIme Change-Id: I5c4e1ea528fdefb676f0db7943098778686624de
2023-04-19Add DefaultImeVisibilityTest to test the visibility of the system default IME. czq
Reset IME to system default IME (adb shell ime reset) and test the show/hide behavoir of it for compatibility in both portrait and landscape mode. Bug: 275666243 Bug: 242838873 Test: atest com.android.inputmethod.stresstest.DefaultImeVisibilityTest Change-Id: I3da5d11e30edd75b3e8f52968158b658abe7fbf5 (cherry picked from commit 755514326cf8b072818891dbb554108480bfcfea) Merged-In: I3da5d11e30edd75b3e8f52968158b658abe7fbf5
2023-04-14Set a simple Ime for Ime stress tests czq
To avoid test failures caused by the default Imes on some test devices overriding some system behavoirs, enable a simple Ime(com.android.apps.inputmethod.simpleime) before test and disable it after test by adding a test rule. Also merge DisableLockRule, PressHomeBeforeTestRule, ScreenOrientationRule into one ImeStressTestRule. Lower the height of SimpleIme to prevent keyboard from covering the input box. Bump up the sdk version of InputMethodStressTests to "current" and fix the falilres in NotificationTest caused by the upgrade. Test: atest com.android.inputmethod.stresstest Bug: 275666243 Bug: 271370105 Bug: 271059090 Bug: 271059311 Change-Id: I7bc097b458761424a2d7e9bbef48aa1f7406fcd3 (cherry picked from commit 19c5ddb5a7632c2d8244878dffa25df412071281) Merged-In: I7bc097b458761424a2d7e9bbef48aa1f7406fcd3
2023-04-13Fix test failures(bug 268231685) on TV targets czq
Fix bug in both InputMethodManagerServiceWindowGainedFocusTest and AutoShowTest by taking screen size into consideration, because IMMS would do auto-show in ImeVisibilityStateComputer#computeState() on large screen devices. Bug: 275666243 Bug: 268231685 Test: atest com.android.server.inputmethod.InputMethodManagerServiceWindowGainedFocusTest Change-Id: Ib8cc36f65386591740c571bba8d6edd41d2373f2 (cherry picked from commit 552a71909856af9e5e7a9668c052b692b5927fec) Merged-In: Ib8cc36f65386591740c571bba8d6edd41d2373f2
2023-03-02Fix NotificationTest on small screen. Kohsuke Yatoh
The send button may be hidden by IME window if the screen size is small. This CL dismisses IME to help UiAutomator find the send button. An alternative approach would be to scroll up the notification. However, the fact that IME window covers notification makes it hard to scroll the notification programatically. Bug: 265259897 Bug: 269715255 Test: atest InputMethodStressTest:NotificationTest#testDirectReply Change-Id: Iad6dd98b01a3ba6824c1bc3ad8b4d9c9a648ad96
2023-02-28Skip notification test on Wear. Jinyi Shan
Direct reply is not supported on Wear. BUG: 269715255 Test: atest InputMethodStressTest Change-Id: I96793414195180cd06a6675f8896e6a79715d1e1
2023-02-07Merge "Add rule to press home before ImeOpenCloseStressTest and AutoShowTest" Ziqi Chen
2023-02-02Add rule to press home before ImeOpenCloseStressTest and AutoShowTest czq
Add PressHomeBeforeTestRule to press home before tests, which avoids test failures when notification page is shown before tests. Bug: 261775358 Test: atest com.android.inputmethod.stresstest.AutoShowTest Test: atest com.android.inputmethod.stresstest.ImeOpenCloseStressTest Change-Id: I55d8f8423429c6a6410722daa613b92e8da20ff5
2023-01-06Remove TODO in InputMethodStressTest Ming-Shin Lu
Since CL[1] has fixed WIC#hide(ime()) not work in onCreate, now we can remove the comment of verifyHideBehavior back for following test methods in ImeOpenCloseStressTest to ensure the test coverage: - testShowHideWithInputMethodManager_onCreate - testHideWithWindowInsetsController_onCraate_requestFocus - testShowHideWithInputMethodManager_inSameFrame Also, in case calling show/hide IME consecutively when in Activity#onCreate that comes before the window focus changed and the final IME visiblity may be affected by SOFT_INPUT_STATE_.* visiblity flag after gaining the window focus, ensure setting SOFT_INPUT_STATE_UNCHANGED flag in following tests: - testHideWithWindowInsetsController_onCreate_requestFocus - testShowHideWithInputMethodManager_onCreate [1]: Id3aebca3348888826bc5d3c6694e94cddb80b4d4 Fix: 248456059 Test: atest InputMethodStressTest:ImeOpenCloseStressTest Change-Id: Ib7baf28036f01201176d2a5bba4ebde319ca8f1a
2022-12-20Disable lock and auto-rotate screen in InputMethodStressTest czq
Add DisableUnlockRule to disable lock screen. Add ScreenOrientationRule to disable auto-rotate screen and set the screen orientation to portrait before test starts. Bug: 261775358 Test: atest com.android.inputmethod.stresstest.ImeOpenCloseStressTest atest com.android.inputmethod.stresstest.AutoShowTest Change-Id: Ic78194158f3c5f25397c696e3599289051a85df6
2022-11-22Extend InputMethodStressTest to add more IME show/hide e2e test cases. czq
Add more IME show/hide test cases to cover different flag settings(window flags, soft input mode flags), show/hide methods (from auto-show/IMM/WIC/Click), call times and user actions. Merge the two TestActivitys in AutoShowTest and ImeOpenCloseStressTest into one in ImeStressTestUtil. Modify test type in TEST_MAPPING to "presubmit-large" to avoid timeout. See go/imf-test-cases for clearer test descriptions and results. Bug: 242838873 Bug: 240359838 Test: atest com.android.inputmethod.stresstest.AutoShowTest atest com.android.inputmethod.stresstest.ImeOpenCloseStressTest Change-Id: Ibff3a85fa5b66c692a2fe8cd69fb1ca521b1b8d8
2022-10-12Extend AutoShowTest to test more softInputMode flags Lan Wei
Extend AutoShowTest to test the behavior of combining various softInputMode flags: * SOFT_INPUT_STATE_UNSPECIFIED * SOFT_INPUT_STATE_HIDDEN * SOFT_INPUT_STATE_ALWAYS_HIDDEN * SOFT_INPUT_STATE_VISIBLE * SOFT_INPUT_STATE_ALWAYS_VISIBLE softInput adjustment flags: * SOFT_INPUT_ADJUST_UNSPECIFIED * SOFT_INPUT_ADJUST_RESIZE * SOFT_INPUT_ADJUST_PAN * SOFT_INPUT_ADJUST_NOTHING set or not set: * SOFT_INPUT_IS_FORWARD_NAVIGATION Flag SOFT_INPUT_STATE_UNCHANGED was not included for now as it requires more than one activities. Bug: 242838873 Bug: 77152727 Test: atest InputMethodStressTest Change-Id: I21ef8073d0b6a582c108141000e23847be6daf33
2022-09-07Activity gain focus failed in InputMethodStressTest ot904697
After the test is completed, the notification is not closed, so that subsequent test cannot get the focus. Close notification in tearDown to solve the issue. Bug: 241723484 Test: run InputMethodStressTest pass Change-Id: I876173e83488e18a884d8bc180f9681e726fff1d
2022-04-27Do not run NotificationTest on TV. Hongguang
Fix: 230550325 Test: atest InputMethodStressTest Change-Id: I52a79356dac2f73a0501a95b865d77812b0dcc2c
2022-04-22Merge "Do not run NotificationTest on Auto." into tm-dev TreeHugger Robot
2022-04-21Do not run NotificationTest on Auto. Kohsuke Yatoh
Bug: 229820964 Test: atest InputMethodStressTest Change-Id: Icf218460fa842f59125c2c09b822b3444ffc1281
2022-04-21Do not cleanup IME window if show is requested. Kohsuke Yatoh
This CL fixes a race condition for IMM#showSoftInput, which surfaces when it's called during an IME hide animation. IMM#showSoftInput ends up calling WIC#show asynchronously, but at that time the running IME hide animation may have already been finished successfully, and WIC#show may fail to cancel the hide animation (then the cleanup IMM#notifyImeHidden hides the IME again disruptively). I think a clean fix is to have IMM#showSoftInput call WIC#show synchronously. However, this requires a significant refactoring. As a short term fix, this CL adds a boolean field indicating whether or not IMM#showSoftInput has been called. If it's called, we skip calling IMM#notifyImeHidden. Bug: 221483132 Bug: 225674038 Test: atest InputMethodStressTest Test: atest CtsInputMethodTestCases Test: atest WindowInsetsAnimationControllerTests Change-Id: I36d570630085d0bc34097a2433208601dc9cb0fd (cherry picked from commit 4c607982ed2d3d23a739232bb0263c4c136a29b8) Merged-In: I36d570630085d0bc34097a2433208601dc9cb0fd
2022-04-21Notify IMMS synchronously on IME insets hidden. Kohsuke Yatoh
Currently, IMMS will be notified asynchronously when an IME hide animation finishes, via message dispatching through IMS (IMM#notifyImeHidden -> IMS#notifyImeHidden -> IMMS#hideMySoftInput). This creates a race condition when IMM#showSoftInput or WIC#show is called around the end of hide animation. This CL fixes the race condition by synchronously and directly calling IMMS#hideSoftInput from IMM#notifyImeHidden. Note that there is still another race condition for IMM#showSoftInput (not WIC#show) if it's called during an IME hide animation; IMM#showSoftInput ended up calling WIC#show asynchronously, but at that time the running IME hide animation may have already been finished successfully and WIC#show may fail to cancel the hide animation (then the cleanup IMM#notifyImeHidden hides the IME again disruptively). I will fix the latter issue in a separate CL. Bug: 221483132 Bug: 225674038 Test: atest InputMethodStressTest Test: atest CtsInputMethodTestCases Test: atest WindowInsetsAnimationControllerTests Change-Id: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2 (cherry picked from commit 9065310f814d38c5d8dea5f01655b30e4996fef4) Merged-In: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2
2022-04-08Use case-insensitive match for action label. Kohsuke Yatoh
The label can be as-is ("Test reply") or all-caps ("TEST REPLY") depending on the system config. Bug: 227712564 Bug: 227424350 Test: atest InputMethodStressTest Change-Id: Id64793f572bec06c84a235fc7688870f44013723
2022-04-08Take screenshot on failure. Kohsuke Yatoh
ScreenCaptureRule is inspired by ScreenshotTestRule [1], but does not require additional permissions as ScreenCaptureRule uses Shell permission. [1] https://cs.android.com/android/platform/superproject/+/master:cts/tests/tests/systemui/src/android/systemui/cts/ScreenshotTestRule.java Bug: 227712564 Bug: 227424350 Test: atest InputMethodStressTest Change-Id: I8569cb09a430540ac3f932e36bc80800312e7865
2022-04-01Unlock screen before test runs. Kohsuke Yatoh
Bug: 227424350 Bug: 227712564 Test: atest InputMethodStressTest Change-Id: I5447c8195f1958f7ac1db2966987ccea31fd3248
2022-03-24Add NotificationTest. Kohsuke Yatoh
NotificationTest tests IME visibility with inline reply. Bug: 195468725 Test: atest InputMethodStressTest Change-Id: I9c96d731ff80ec289cee1b62c081c250545b4a35
2022-03-22Wait for IME animation to end before calling IMM. Kohsuke Yatoh
Due to b/221483132, IMM#showSoftInput() may not work while IME is animating. NUM_TEST_ITERATIONS is reduced to avoid test timeout. Bug: 220385622 Test: atest InputMethodStressTest Change-Id: If2a9d6e88b801faf491141f5f702b735a490a8db
2021-10-08Add autoshow testcase. Kohsuke Yatoh
Autoshow is a feature of InputMethodManagerService. This feature is not documented nor guarded by CTS. A non-CTS regression test will be useful for keeping UX consistency across Android versions. Bug: 195468725 Test: atest InputMethodStressTest Change-Id: I8025ff9b7813d0d5552f1ff84fff018bd0a178fa
2021-10-05Fix the directory of IME stress test. Kohsuke Yatoh
I failed to rename directories correctly in commit 08603e695f9500893709b5ff746d1dff5b5d8320 Bug: 195468725 Test: n/a Change-Id: Iafbe1ed0443acd499eecb9ca683ac86d54955578
2021-08-05Initial commit of InputMethodStressTest. Kohsuke Yatoh
This CL added a simple test of showing and hiding IME for 100 times. TODOs: 1. Add more complicated flows (such as notification). 2. Check IME visibility in several points (WindowManager dump, SurfaceFlinger dump, etc), not just the inset that the app received. Bug: 195468725 Test: atest InputMethodStressTest Change-Id: I1959225a7396d17750d799e11c42eb1899fe5bb9