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 <option name="config-descriptor:metadata" key="parameter" value="run_on_sdk_sandbox" /> 26 <!-- 27 TODO(yukawa): come up with a proper way to take care of devices that do not support 28 installable IMEs. Ideally target_preparer should have an option to annotate required 29 features, e.g. android.software.input_methods so that we can conditionally install APKs 30 based on the feature supported in the target device. 31 --> 32 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 33 <option name="cleanup-apks" value="true" /> 34 <!-- 35 MockIME always needs to be instaleld as a full package, even when CTS is running 36 for instant apps. 37 --> 38 <option name="force-install-mode" value="FULL"/> 39 <option name="test-file-name" value="CtsMockInputMethod.apk" /> 40 </target_preparer> 41 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 42 <option name="cleanup-apks" value="true" /> 43 <!-- 44 MockSpellChecker always needs to be instaleld as a full package, even when CTS is 45 running for instant apps. 46 --> 47 <option name="force-install-mode" value="FULL"/> 48 <option name="test-file-name" value="CtsMockSpellChecker.apk" /> 49 </target_preparer> 50 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 51 <option name="cleanup-apks" value="true" /> 52 <!-- 53 SpellCheckingIme always needs to be instaleld as a full package, even when CTS is 54 running for instant apps. 55 --> 56 <option name="force-install-mode" value="FULL"/> 57 <option name="test-file-name" value="CtsSpellCheckingIme.apk" /> 58 </target_preparer> 59 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 60 <option name="cleanup-apks" value="true" /> 61 <!-- 62 HiddenFromPickerIme always needs to be installed as a full package, even when CTS is 63 running for instant apps. 64 --> 65 <option name="force-install-mode" value="FULL"/> 66 <option name="test-file-name" value="CtsHiddenFromPickerIme.apk" /> 67 </target_preparer> 68 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 69 <option name="cleanup-apks" value="true" /> 70 <!-- 71 CtsMockA11yInputMethod always needs to be instaleld as a full package, even when CTS is 72 running for instant apps. 73 --> 74 <option name="force-install-mode" value="FULL"/> 75 <option name="test-file-name" value="CtsMockA11yInputMethod.apk" /> 76 </target_preparer> 77 <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> 78 <option name="cleanup" value="true" /> 79 <!-- 80 CtsMockLargeResourceInputMethod should not always be installed, but the apk must be 81 available. 82 --> 83 <option name="push" value="CtsMockLargeResourceInputMethod.apk->/data/local/tmp/cts/inputmethod/CtsMockLargeResourceInputMethod.apk" /> 84 </target_preparer> 85 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 86 <option name="cleanup-apks" value="true" /> 87 <!-- 88 CtsMockInputMethodWithSubtypes always needs to be installed as a full package, even when 89 CTS is running for instant apps. 90 --> 91 <option name="force-install-mode" value="FULL"/> 92 <option name="test-file-name" value="CtsMockInputMethodWithSubtypes.apk" /> 93 </target_preparer> 94 95 <!-- 96 TODO(yukawa): come up with a proper way to take care of devices that do not support 97 installable IMEs. Ideally target_preparer should have an option to annotate required 98 features, e.g. android.software.input_methods so that we can conditionally install APKs 99 based on the feature supported in the target device. 100 --> 101 102 <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> 103 <option name="run-command" value="input keyevent KEYCODE_WAKEUP" /> 104 <option name="run-command" value="wm dismiss-keyguard" /> 105 </target_preparer> 106 107 <!-- 108 A (separate) standalone test app APK is needed to test implicit app-visibility from the IME 109 process to the IME target process, because if the IME target process is directly interacting 110 with MockIme process via MockImeSession, then the system would already give the MockIme an 111 implicit app-visibility back to the test app. To fully test app-visibility scenario, 112 MockImeSession cannot be used in the process where the focused Activity is hosted. 113 --> 114 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 115 <option name="cleanup-apks" value="true" /> 116 <!-- 117 In order to simulate the scenario where the IME client process is normally 118 installed, explicitly set false here. Otherwise, the test APP will be installed under 119 force-queryable mode, which makes the test useless. 120 --> 121 <option name="force-queryable" value="false" /> 122 <option name="test-file-name" value="CtsInputMethodStandaloneTestApp.apk" /> 123 </target_preparer> 124 125 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 126 <option name="cleanup-apks" value="true" /> 127 <option name="install-arg" value="-t" /> 128 <option name="test-file-name" value="CtsInputMethodTestCases.apk" /> 129 </target_preparer> 130 <!-- Enabling change id ALLOW_TEST_API_ACCESS allows that package to access @TestApi methods --> 131 <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> 132 <option name="run-command" value="am compat enable ALLOW_TEST_API_ACCESS com.android.cts.mockime" /> 133 <option name="teardown-command" value="am compat reset ALLOW_TEST_API_ACCESS com.android.cts.mockime" /> 134 <option name="run-command" value="am compat enable ALLOW_TEST_API_ACCESS com.android.cts.mocka11yime" /> 135 <option name="teardown-command" value="am compat reset ALLOW_TEST_API_ACCESS com.android.cts.mocka11yime" /> 136 <option name="run-command" value="am compat enable ALLOW_TEST_API_ACCESS android.view.inputmethod.ctstestapp" /> 137 <option name="teardown-command" value="am compat reset ALLOW_TEST_API_ACCESS android.view.inputmethod.ctstestapp" /> 138 <option name="run-command" value="am compat enable ALLOW_TEST_API_ACCESS android.view.inputmethod.mocklargeresourceime" /> 139 <option name="teardown-command" value="am compat reset ALLOW_TEST_API_ACCESS android.view.inputmethod.mocklargeresourceime" /> 140 <option name="teardown-command" value="am compat reset ALLOW_TEST_API_ACCESS android.view.inputmethod.mockimewithsubtypes" /> 141 142 <!-- Wait for PACKAGE_ADDED broadcasts to be delivered to InputMethodManagerService. --> 143 <option name="run-command" value="am wait-for-broadcast-barrier" /> 144 <!-- Dismiss any system dialogs (e.g. crashes, ANR). --> 145 <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" /> 146 </target_preparer> 147 148 <!-- Create a place to store files for DumpOnFailure --> 149 <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> 150 <option name="run-command" value="mkdir -p /sdcard/DumpOnFailure" /> 151 </target_preparer> 152 <!-- Collect the files from DumpOnFailure. --> 153 <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector"> 154 <option name="directory-keys" value="/sdcard/DumpOnFailure" /> 155 <option name="collect-on-run-ended-only" value="true" /> 156 </metrics_collector> 157 158 <test class="com.android.tradefed.testtype.AndroidJUnitTest" > 159 <option name="package" value="android.view.inputmethod.cts" /> 160 <option name="runtime-hint" value="1m0s" /> 161 </test> 162</configuration> 163