Commit Graph

19 Commits

Author SHA1 Message Date
czq
19e01a7c8b Extend InputMethodStressTest to add more IME show/hide e2e test cases.
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-11-22 13:27:29 +08:00
Lan Wei
d0091597f7 Extend AutoShowTest to test more softInputMode flags
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-10-12 13:42:28 +08:00
ot904697
19a0a4ec91 Activity gain focus failed in InputMethodStressTest
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-09-07 03:16:46 +00:00
Hongguang
fa49a958c8 Do not run NotificationTest on TV.
Fix: 230550325
Test: atest InputMethodStressTest
Change-Id: I52a79356dac2f73a0501a95b865d77812b0dcc2c
2022-04-27 03:57:10 +00:00
TreeHugger Robot
c3947aa6ff Merge "Do not run NotificationTest on Auto." into tm-dev 2022-04-22 05:58:06 +00:00
Kohsuke Yatoh
7f1e7a1e65 Do not run NotificationTest on Auto.
Bug: 229820964
Test: atest InputMethodStressTest
Change-Id: Icf218460fa842f59125c2c09b822b3444ffc1281
2022-04-21 17:35:17 -07:00
Kohsuke Yatoh
eae7ca8165 Do not cleanup IME window if show is requested.
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 4c607982ed)
Merged-In: I36d570630085d0bc34097a2433208601dc9cb0fd
2022-04-21 21:34:31 +00:00
Kohsuke Yatoh
4844170377 Notify IMMS synchronously on IME insets hidden.
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 9065310f81)
Merged-In: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2
2022-04-21 21:34:24 +00:00
Kohsuke Yatoh
fcfbaa6b61 Use case-insensitive match for action label.
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-08 17:31:41 -07:00
Kohsuke Yatoh
f75e0a0512 Take screenshot on failure.
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-08 17:31:26 -07:00
Kohsuke Yatoh
f2081f6a3e Unlock screen before test runs.
Bug: 227424350
Bug: 227712564
Test: atest InputMethodStressTest
Change-Id: I5447c8195f1958f7ac1db2966987ccea31fd3248
2022-04-01 23:09:13 +00:00
Kohsuke Yatoh
f2f9272e3e Add NotificationTest.
NotificationTest tests IME visibility with inline reply.

Bug: 195468725
Test: atest InputMethodStressTest
Change-Id: I9c96d731ff80ec289cee1b62c081c250545b4a35
2022-03-24 22:04:31 +00:00
Kohsuke Yatoh
b78d42ab88 Wait for IME animation to end before calling IMM.
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
2022-03-22 13:57:39 -07:00
Kohsuke Yatoh
fd0314d65a Drop "adb shell" from RunCommandTargetPreparer.
The command should not have "adb shell", as the command is passed to
the device shell by RunCommandTargetPreparer.

Bug: 220385622
Test: atest InputMethodStressTest
Change-Id: I95a90d73e2c26c0ad21d5000b19ff8d805de5250
2022-03-21 15:09:15 -07:00
Kohsuke Yatoh
27f81d551b Always show virtual keyboard in test.
Some emulators have a physical keyboard and the test fails if the
default IME suppresses itself.
Set show_ime_with_hard_keyboard setting to request always showing
virtual keyboard.

Bug: 220385622
Test: atest InputMethodStressTest
Change-Id: Iaf0d30635ca94ae044bb3d3ed771387ce2288cb3
2022-02-23 19:13:49 +00:00
Kohsuke Yatoh
6b94ea578b Add TEST_MAPPING for InputMethodStressTest.
Bug: 195468725
Test: atest --dry-run --test-mapping frameworks/base/tests/InputMethodStressTest:presubmit
Change-Id: I4cf126240f162cd45597ebcc232ccedb80abc745
2021-10-15 23:49:44 +00:00
Kohsuke Yatoh
454d76153f Add autoshow testcase.
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-08 18:43:27 +00:00
Kohsuke Yatoh
24a7ba9da3 Fix the directory of IME stress test.
I failed to rename directories correctly in
commit 08603e695f

Bug: 195468725
Test: n/a
Change-Id: Iafbe1ed0443acd499eecb9ca683ac86d54955578
2021-10-05 00:28:58 +00:00
Kohsuke Yatoh
08603e695f Initial commit of InputMethodStressTest.
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
2021-08-05 16:58:13 -07:00