Skip to content

Commit d258532

Browse files
Nikolas HavrikovGregory Montoir
authored andcommitted
Exempt IME tests from preemptible IME config
The tests in question are not compatible with the config_preventImeStartupUnlessTextEditor configuration option as they expect IME connections to be started, which does not happen with the setting activated. Bug: 309378031 Test: atest ImeInsetsVisibilityTest InputMethodServiceTest Test: atest SearchViewTest FocusHandlingTest Change-Id: I2dfcb118b8f96d988c1fd2c9aefc98e2b1f9e872 Merged-In: I2dfcb118b8f96d988c1fd2c9aefc98e2b1f9e872
1 parent 32136f4 commit d258532

4 files changed

Lines changed: 11 additions & 0 deletions

File tree

tests/inputmethod/src/android/view/inputmethod/cts/FocusHandlingTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ public void testSoftInputStateAlwaysVisibleFocusedEditorView() throws Exception
425425
@ApiTest(apis = {"android.inputmethodservice.InputMethodService#showSoftInput"})
426426
@Test
427427
public void testSoftInputStateAlwaysVisibleFocusEditorAfterLaunch() throws Exception {
428+
Assume.assumeFalse(isPreventImeStartup());
428429
final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
429430
try (MockImeSession imeSession = createTestImeSession()) {
430431
final ImeEventStream stream = imeSession.openEventStream();

tests/inputmethod/src/android/view/inputmethod/cts/ImeInsetsVisibilityTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import com.android.cts.mockime.ImeSettings;
7171
import com.android.cts.mockime.MockImeSession;
7272

73+
import org.junit.Assume;
7374
import org.junit.Rule;
7475
import org.junit.Test;
7576
import org.junit.runner.RunWith;
@@ -96,6 +97,7 @@ private static String getTestMarker() {
9697

9798
@Test
9899
public void testImeVisibilityWhenImeFocusableChildPopup() throws Exception {
100+
Assume.assumeFalse(isPreventImeStartup());
99101
final InputMethodManager imm = getImmOrFail();
100102

101103
try (MockImeSession imeSession = MockImeSession.create(
@@ -143,6 +145,7 @@ public void testImeVisibilityWhenImeFocusableChildPopup() throws Exception {
143145

144146
@Test
145147
public void testImeVisibilityWhenImeFocusableGravityBottomChildPopup() throws Exception {
148+
Assume.assumeFalse(isPreventImeStartup());
146149
final InputMethodManager imm = getImmOrFail();
147150

148151
try (MockImeSession imeSession = MockImeSession.create(
@@ -191,6 +194,7 @@ public void testImeVisibilityWhenImeFocusableGravityBottomChildPopup() throws Ex
191194

192195
@Test
193196
public void testImeVisibilityWhenImeFocusableChildPopupOverlaps() throws Exception {
197+
Assume.assumeFalse(isPreventImeStartup());
194198
final InputMethodManager imm = getImmOrFail();
195199

196200
try (MockImeSession imeSession = MockImeSession.create(
@@ -240,6 +244,7 @@ public void testImeVisibilityWhenImeFocusableChildPopupOverlaps() throws Excepti
240244
@AppModeFull(reason = "Instant apps cannot rely on ACTION_CLOSE_SYSTEM_DIALOGS")
241245
@Test
242246
public void testEditTextPositionAndPersistWhenAboveImeWindowShown() throws Exception {
247+
Assume.assumeFalse(isPreventImeStartup());
243248
final InputMethodManager imm = getImmOrFail();
244249

245250
try (MockImeSession imeSession = MockImeSession.create(

tests/inputmethod/src/android/view/inputmethod/cts/InputMethodServiceTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
import com.android.cts.mockime.ImeSettings;
105105
import com.android.cts.mockime.MockImeSession;
106106

107+
import org.junit.Assume;
107108
import org.junit.Before;
108109
import org.junit.Ignore;
109110
import org.junit.Rule;
@@ -210,6 +211,7 @@ public void verifyLayoutInflaterContext() throws Exception {
210211

211212
@Test
212213
public void testSwitchInputMethod_verifiesEnabledState() throws Exception {
214+
Assume.assumeFalse(isPreventImeStartup());
213215
SystemUtil.runShellCommand("ime disable " + OTHER_IME_ID);
214216
try (MockImeSession imeSession = MockImeSession.create(
215217
InstrumentationRegistry.getInstrumentation().getContext(),
@@ -233,6 +235,7 @@ public void testSwitchInputMethod_verifiesEnabledState() throws Exception {
233235
}
234236
@Test
235237
public void testSwitchInputMethodWithSubtype_verifiesEnabledState() throws Exception {
238+
Assume.assumeFalse(isPreventImeStartup());
236239
SystemUtil.runShellCommand("ime disable " + OTHER_IME_ID);
237240
try (MockImeSession imeSession = MockImeSession.create(
238241
InstrumentationRegistry.getInstrumentation().getContext(),

tests/inputmethod/src/android/view/inputmethod/cts/SearchViewTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import com.android.cts.mockime.ImeSettings;
4949
import com.android.cts.mockime.MockImeSession;
5050

51+
import org.junit.Assume;
5152
import org.junit.Rule;
5253
import org.junit.Test;
5354
import org.junit.runner.RunWith;
@@ -179,6 +180,7 @@ public void testShowImeWithSearchViewFocus() throws Exception {
179180

180181
@Test
181182
public void testShowImeWhenSearchViewFocusInListView() throws Exception {
183+
Assume.assumeFalse(isPreventImeStartup());
182184
try (MockImeSession imeSession = MockImeSession.create(
183185
InstrumentationRegistry.getInstrumentation().getContext(),
184186
InstrumentationRegistry.getInstrumentation().getUiAutomation(),

0 commit comments

Comments
 (0)