Loading tests/FlickerTests/src/com/android/server/wm/flicker/CommonTransitions.java +5 −4 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ class CommonTransitions { .runBefore(device::pressHome) .runBefore(() -> setRotation(device, beginRotation)) .runBefore(testApp::open) .run(() -> testApp.clickEditTextWidget(device)) .run(() -> testApp.openIME(device)) .runAfterAll(testApp::exit) .repeat(ITERATIONS); } Loading Loading @@ -244,7 +244,8 @@ class CommonTransitions { By.res(device.getLauncherPackageName(), "snapshot")); snapshot.click(); }) .runBefore(() -> testAppBottom.clickEditTextWidget(device)) .runBefore(() -> testAppBottom.openIME(device)) .runBefore(device::pressBack) .runBefore(() -> AutomationUtils.resizeSplitScreen(device, startRatio)) .run(() -> AutomationUtils.resizeSplitScreen(device, stopRatio)) .runAfter(() -> exitSplitScreen(device)) Loading @@ -264,7 +265,7 @@ class CommonTransitions { .runBefore(device::pressHome) .runBefore(() -> setRotation(device, beginRotation)) .runBefore(testApp::open) .runBefore(() -> testApp.clickEditTextWidget(device)) .runBefore(() -> testApp.openIME(device)) .run(device::pressHome) .run(device::waitForIdle) .runAfterAll(testApp::exit) Loading @@ -281,7 +282,7 @@ class CommonTransitions { .runBefore(device::pressHome) .runBefore(() -> setRotation(device, beginRotation)) .runBefore(testApp::open) .runBefore(() -> testApp.clickEditTextWidget(device)) .runBefore(() -> testApp.openIME(device)) .run(device::pressBack) .run(device::waitForIdle) .runAfterAll(testApp::exit) Loading tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppAutoFocusHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ public class ImeAppAutoFocusHelper extends ImeAppHelper { super(instr, "ImeAppAutoFocus"); } public void clickEditTextWidget(UiDevice device) { public void openIME(UiDevice device) { // do nothing (the app is focused automatically) } } tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.java +10 −5 Original line number Diff line number Diff line Loading @@ -16,14 +16,14 @@ package com.android.server.wm.flicker.helpers; import static android.os.SystemClock.sleep; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import android.app.Instrumentation; import android.support.test.uiautomator.By; import android.support.test.uiautomator.UiDevice; import android.support.test.uiautomator.UiObject2; import android.support.test.uiautomator.Until; public class ImeAppHelper extends FlickerAppHelper { Loading @@ -35,11 +35,16 @@ public class ImeAppHelper extends FlickerAppHelper { this(instr, "ImeApp"); } public void clickEditTextWidget(UiDevice device) { UiObject2 editText = device.findObject(By.res(getPackage(), "plain_text_input")); public void openIME(UiDevice device) { UiObject2 editText = device.wait( Until.findObject(By.res(getPackage(), "plain_text_input")), AutomationUtils.FIND_TIMEOUT); assertNotNull("Text field not found, this usually happens when the device was left " + "in an unknown state (e.g. in split screen)", editText); editText.click(); sleep(500); if (!AutomationUtils.waitForIME(device)) { fail("IME did not appear"); } } } Loading
tests/FlickerTests/src/com/android/server/wm/flicker/CommonTransitions.java +5 −4 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ class CommonTransitions { .runBefore(device::pressHome) .runBefore(() -> setRotation(device, beginRotation)) .runBefore(testApp::open) .run(() -> testApp.clickEditTextWidget(device)) .run(() -> testApp.openIME(device)) .runAfterAll(testApp::exit) .repeat(ITERATIONS); } Loading Loading @@ -244,7 +244,8 @@ class CommonTransitions { By.res(device.getLauncherPackageName(), "snapshot")); snapshot.click(); }) .runBefore(() -> testAppBottom.clickEditTextWidget(device)) .runBefore(() -> testAppBottom.openIME(device)) .runBefore(device::pressBack) .runBefore(() -> AutomationUtils.resizeSplitScreen(device, startRatio)) .run(() -> AutomationUtils.resizeSplitScreen(device, stopRatio)) .runAfter(() -> exitSplitScreen(device)) Loading @@ -264,7 +265,7 @@ class CommonTransitions { .runBefore(device::pressHome) .runBefore(() -> setRotation(device, beginRotation)) .runBefore(testApp::open) .runBefore(() -> testApp.clickEditTextWidget(device)) .runBefore(() -> testApp.openIME(device)) .run(device::pressHome) .run(device::waitForIdle) .runAfterAll(testApp::exit) Loading @@ -281,7 +282,7 @@ class CommonTransitions { .runBefore(device::pressHome) .runBefore(() -> setRotation(device, beginRotation)) .runBefore(testApp::open) .runBefore(() -> testApp.clickEditTextWidget(device)) .runBefore(() -> testApp.openIME(device)) .run(device::pressBack) .run(device::waitForIdle) .runAfterAll(testApp::exit) Loading
tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppAutoFocusHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ public class ImeAppAutoFocusHelper extends ImeAppHelper { super(instr, "ImeAppAutoFocus"); } public void clickEditTextWidget(UiDevice device) { public void openIME(UiDevice device) { // do nothing (the app is focused automatically) } }
tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.java +10 −5 Original line number Diff line number Diff line Loading @@ -16,14 +16,14 @@ package com.android.server.wm.flicker.helpers; import static android.os.SystemClock.sleep; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import android.app.Instrumentation; import android.support.test.uiautomator.By; import android.support.test.uiautomator.UiDevice; import android.support.test.uiautomator.UiObject2; import android.support.test.uiautomator.Until; public class ImeAppHelper extends FlickerAppHelper { Loading @@ -35,11 +35,16 @@ public class ImeAppHelper extends FlickerAppHelper { this(instr, "ImeApp"); } public void clickEditTextWidget(UiDevice device) { UiObject2 editText = device.findObject(By.res(getPackage(), "plain_text_input")); public void openIME(UiDevice device) { UiObject2 editText = device.wait( Until.findObject(By.res(getPackage(), "plain_text_input")), AutomationUtils.FIND_TIMEOUT); assertNotNull("Text field not found, this usually happens when the device was left " + "in an unknown state (e.g. in split screen)", editText); editText.click(); sleep(500); if (!AutomationUtils.waitForIME(device)) { fail("IME did not appear"); } } }