• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  Copyright (C) 2017 The Android Open Source Project
4
5  Licensed under the Apache License, Version 2.0 (the "License");
6  you may not use this file except in compliance with the License.
7  You may obtain a copy of the License at
8
9       http://www.apache.org/licenses/LICENSE-2.0
10
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16-->
17
18<configuration description="Config for CTS InputMethod test cases">
19    <option name="test-suite-tag" value="cts" />
20    <option name="config-descriptor:metadata" key="component" value="inputmethod" />
21    <option name="config-descriptor:metadata" key="parameter" value="all_foldable_states" />
22    <option name="config-descriptor:metadata" key="parameter" value="instant_app" />
23    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
24    <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
25    <!--
26        TODO(yukawa): come up with a proper way to take care of devices that do not support
27        installable IMEs.  Ideally target_preparer should have an option to annotate required
28        features, e.g. android.software.input_methods so that we can conditionally install APKs
29        based on the feature supported in the target device.
30    -->
31    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
32        <option name="cleanup-apks" value="true" />
33        <!--
34            MockIME always needs to be instaleld as a full package, even when CTS is running
35            for instant apps.
36        -->
37        <option name="force-install-mode" value="FULL"/>
38        <option name="test-file-name" value="CtsMockInputMethod.apk" />
39    </target_preparer>
40    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
41        <option name="cleanup-apks" value="true" />
42        <!--
43            MockSpellChecker always needs to be instaleld as a full package, even when CTS is
44            running for instant apps.
45        -->
46        <option name="force-install-mode" value="FULL"/>
47        <option name="test-file-name" value="CtsMockSpellChecker.apk" />
48    </target_preparer>
49    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
50        <option name="cleanup-apks" value="true" />
51        <!--
52            SpellCheckingIme always needs to be instaleld as a full package, even when CTS is
53            running for instant apps.
54        -->
55        <option name="force-install-mode" value="FULL"/>
56        <option name="test-file-name" value="CtsSpellCheckingIme.apk" />
57    </target_preparer>
58    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
59        <option name="cleanup-apks" value="true" />
60        <!--
61            HiddenFromPickerIme always needs to be installed as a full package, even when CTS is
62            running for instant apps.
63        -->
64        <option name="force-install-mode" value="FULL"/>
65        <option name="test-file-name" value="CtsHiddenFromPickerIme.apk" />
66    </target_preparer>
67    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
68        <option name="cleanup-apks" value="true" />
69        <!--
70            CtsMockA11yInputMethod always needs to be instaleld as a full package, even when CTS is
71            running for instant apps.
72        -->
73        <option name="force-install-mode" value="FULL"/>
74        <option name="test-file-name" value="CtsMockA11yInputMethod.apk" />
75    </target_preparer>
76    <!--
77        TODO(yukawa): come up with a proper way to take care of devices that do not support
78        installable IMEs.  Ideally target_preparer should have an option to annotate required
79        features, e.g. android.software.input_methods so that we can conditionally install APKs
80        based on the feature supported in the target device.
81    -->
82
83    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
84        <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
85        <option name="run-command" value="wm dismiss-keyguard" />
86    </target_preparer>
87
88    <!--
89        A (separate) standalone test app APK is needed to test implicit app-visibility from the IME
90        process to the IME target process, because if the IME target process is directly interacting
91        with MockIme process via MockImeSession, then the system would already give the MockIme an
92        implicit app-visibility back to the test app.  To fully test app-visibility scenario,
93        MockImeSession cannot be used in the process where the focused Activity is hosted.
94    -->
95    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
96        <option name="cleanup-apks" value="true" />
97        <!--
98            In order to simulate the scenario where the IME client process is normally
99            installed, explicitly set false here.  Otherwise, the test APP will be installed under
100            force-queryable mode, which makes the test useless.
101        -->
102        <option name="force-queryable" value="false" />
103        <option name="test-file-name" value="CtsInputMethodStandaloneTestApp.apk" />
104    </target_preparer>
105
106    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
107        <option name="cleanup-apks" value="true" />
108        <option name="install-arg" value="-t" />
109        <option name="test-file-name" value="CtsInputMethodTestCases.apk" />
110    </target_preparer>
111    <!-- Enabling change id ALLOW_TEST_API_ACCESS allows that package to access @TestApi methods -->
112    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
113        <option name="run-command" value="am compat enable ALLOW_TEST_API_ACCESS com.android.cts.mockime"  />
114        <option name="teardown-command" value="am compat reset ALLOW_TEST_API_ACCESS com.android.cts.mockime" />
115        <option name="run-command" value="am compat enable ALLOW_TEST_API_ACCESS com.android.cts.mocka11yime"  />
116        <option name="teardown-command" value="am compat reset ALLOW_TEST_API_ACCESS com.android.cts.mocka11yime" />
117        <option name="run-command" value="am compat enable ALLOW_TEST_API_ACCESS android.view.inputmethod.ctstestapp"  />
118        <option name="teardown-command" value="am compat reset ALLOW_TEST_API_ACCESS android.view.inputmethod.ctstestapp" />
119
120        <!-- Wait for PACKAGE_ADDED broadcasts to be delivered to InputMethodManagerService. -->
121        <option name="run-command" value="am wait-for-broadcast-idle"  />
122    </target_preparer>
123    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
124        <option name="package" value="android.view.inputmethod.cts" />
125        <option name="runtime-hint" value="1m0s" />
126    </test>
127</configuration>
128