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

Commit 19c5ddb5 authored by czq's avatar czq
Browse files

Set a simple Ime for Ime stress tests

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: 271370105
Bug: 271059090
Bug: 271059311
Change-Id: I7bc097b458761424a2d7e9bbef48aa1f7406fcd3
parent d66f6e75
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@
  -->

<resources>
    <dimen name="text_size_normal">24dp</dimen>
    <dimen name="text_size_normal">20dp</dimen>
    <dimen name="text_size_symbol">14dp</dimen>

    <dimen name="keyboard_header_height">40dp</dimen>
    <dimen name="keyboard_row_height">50dp</dimen>
    <dimen name="keyboard_header_height">30dp</dimen>
    <dimen name="keyboard_row_height">40dp</dimen>
</resources>
 No newline at end of file
+4 −1
Original line number Diff line number Diff line
@@ -32,5 +32,8 @@ android_test {
        "general-tests",
        "vts",
    ],
    sdk_version: "31",
    data: [
        ":SimpleTestIme",
    ],
    sdk_version: "current",
}
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.android.inputmethod.stresstest">

    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <application>
        <activity android:name=".ImeStressTestUtil$TestActivity"
                  android:configChanges="orientation|screenSize"/>
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@

    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="cleanup-apks" value="true" />
        <option name="test-file-name" value="SimpleTestIme.apk" />
        <option name="test-file-name" value="InputMethodStressTest.apk" />
    </target_preparer>

+4 −8
Original line number Diff line number Diff line
@@ -61,14 +61,10 @@ import java.util.List;
@RunWith(Parameterized.class)
public final class AutoShowTest {

    @Rule(order = 0) public DisableLockScreenRule mDisableLockScreenRule =
            new DisableLockScreenRule();
    @Rule(order = 1) public UnlockScreenRule mUnlockScreenRule = new UnlockScreenRule();
    @Rule(order = 2) public ScreenOrientationRule mScreenOrientationRule =
            new ScreenOrientationRule(true /* isPortrait */);
    @Rule(order = 3) public PressHomeBeforeTestRule mPressHomeBeforeTestRule =
            new PressHomeBeforeTestRule();
    @Rule(order = 4) public ScreenCaptureRule mScreenCaptureRule =
    @Rule(order = 0) public UnlockScreenRule mUnlockScreenRule = new UnlockScreenRule();
    @Rule(order = 1) public ImeStressTestRule mImeStressTestRule =
        new ImeStressTestRule(true /* useSimpleTestIme */);
    @Rule(order = 2) public ScreenCaptureRule mScreenCaptureRule =
            new ScreenCaptureRule("/sdcard/InputMethodStressTest");
    @Parameterized.Parameters(
            name = "windowFocusFlags={0}, softInputVisibility={1}, softInputAdjustment={2}")
Loading