Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/ImeAppHelper.kt +0 −6 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.app.Instrumentation import androidx.test.uiautomator.By import androidx.test.uiautomator.By import androidx.test.uiautomator.Until import androidx.test.uiautomator.Until import com.android.server.wm.flicker.helpers.FIND_TIMEOUT import com.android.server.wm.flicker.helpers.FIND_TIMEOUT import com.android.server.wm.flicker.helpers.waitForIME import com.android.wm.shell.flicker.TEST_APP_IME_ACTIVITY_LABEL import com.android.wm.shell.flicker.TEST_APP_IME_ACTIVITY_LABEL import com.android.wm.shell.flicker.testapp.Components import com.android.wm.shell.flicker.testapp.Components import org.junit.Assert import org.junit.Assert Loading @@ -39,14 +38,9 @@ open class ImeAppHelper( Assert.assertNotNull("Text field not found, this usually happens when the device " + Assert.assertNotNull("Text field not found, this usually happens when the device " + "was left in an unknown state (e.g. in split screen)", editText) "was left in an unknown state (e.g. in split screen)", editText) editText.click() editText.click() if (!uiDevice.waitForIME()) { Assert.fail("IME did not appear") } } } fun closeIME() { fun closeIME() { uiDevice.pressBack() uiDevice.pressBack() // Using only the AccessibilityInfo it is not possible to identify if the IME is active uiDevice.waitForIdle(1000) } } } } No newline at end of file libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt +10 −0 Original line number Original line Diff line number Diff line Loading @@ -25,8 +25,10 @@ import com.android.server.wm.flicker.helpers.WindowUtils import com.android.server.wm.flicker.helpers.closePipWindow import com.android.server.wm.flicker.helpers.closePipWindow import com.android.server.wm.flicker.helpers.hasPipWindow import com.android.server.wm.flicker.helpers.hasPipWindow import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper import com.android.wm.shell.flicker.IME_WINDOW_NAME import com.android.wm.shell.flicker.IME_WINDOW_NAME import com.android.wm.shell.flicker.helpers.ImeAppHelper import com.android.wm.shell.flicker.helpers.ImeAppHelper import com.android.wm.shell.flicker.testapp.Components import org.junit.FixMethodOrder import org.junit.FixMethodOrder import org.junit.Test import org.junit.Test import org.junit.runner.RunWith import org.junit.runner.RunWith Loading @@ -46,6 +48,8 @@ class PipKeyboardTest( rotation: Int rotation: Int ) : PipTestBase(rotationName, rotation) { ) : PipTestBase(rotationName, rotation) { private val keyboardApp = ImeAppHelper(instrumentation) private val keyboardApp = ImeAppHelper(instrumentation) private val keyboardComponent = Components.ImeActivity().componentName private val helper = WindowManagerStateHelper() private val keyboardScenario: FlickerBuilder private val keyboardScenario: FlickerBuilder get() = FlickerBuilder(instrumentation).apply { get() = FlickerBuilder(instrumentation).apply { Loading @@ -64,6 +68,8 @@ class PipKeyboardTest( // UiAutomator doesn't support to launch the multiple Activities in a task. // UiAutomator doesn't support to launch the multiple Activities in a task. // So use launchActivity() for the Keyboard Activity. // So use launchActivity() for the Keyboard Activity. keyboardApp.launchViaIntent() keyboardApp.launchViaIntent() helper.waitForAppTransitionIdle() helper.waitForFullScreenApp(keyboardComponent) } } } } teardown { teardown { Loading @@ -88,9 +94,11 @@ class PipKeyboardTest( transitions { transitions { // open the soft keyboard // open the soft keyboard keyboardApp.openIME() keyboardApp.openIME() helper.waitImeWindowShown() // then close it again // then close it again keyboardApp.closeIME() keyboardApp.closeIME() helper.waitImeWindowGone() } } assertions { assertions { windowManagerTrace { windowManagerTrace { Loading @@ -112,11 +120,13 @@ class PipKeyboardTest( transitions { transitions { // open the soft keyboard // open the soft keyboard keyboardApp.openIME() keyboardApp.openIME() helper.waitImeWindowShown() } } teardown { teardown { eachRun { eachRun { // close the keyboard // close the keyboard keyboardApp.closeIME() keyboardApp.closeIME() helper.waitImeWindowGone() } } } } assertions { assertions { Loading Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/ImeAppHelper.kt +0 −6 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.app.Instrumentation import androidx.test.uiautomator.By import androidx.test.uiautomator.By import androidx.test.uiautomator.Until import androidx.test.uiautomator.Until import com.android.server.wm.flicker.helpers.FIND_TIMEOUT import com.android.server.wm.flicker.helpers.FIND_TIMEOUT import com.android.server.wm.flicker.helpers.waitForIME import com.android.wm.shell.flicker.TEST_APP_IME_ACTIVITY_LABEL import com.android.wm.shell.flicker.TEST_APP_IME_ACTIVITY_LABEL import com.android.wm.shell.flicker.testapp.Components import com.android.wm.shell.flicker.testapp.Components import org.junit.Assert import org.junit.Assert Loading @@ -39,14 +38,9 @@ open class ImeAppHelper( Assert.assertNotNull("Text field not found, this usually happens when the device " + Assert.assertNotNull("Text field not found, this usually happens when the device " + "was left in an unknown state (e.g. in split screen)", editText) "was left in an unknown state (e.g. in split screen)", editText) editText.click() editText.click() if (!uiDevice.waitForIME()) { Assert.fail("IME did not appear") } } } fun closeIME() { fun closeIME() { uiDevice.pressBack() uiDevice.pressBack() // Using only the AccessibilityInfo it is not possible to identify if the IME is active uiDevice.waitForIdle(1000) } } } } No newline at end of file
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt +10 −0 Original line number Original line Diff line number Diff line Loading @@ -25,8 +25,10 @@ import com.android.server.wm.flicker.helpers.WindowUtils import com.android.server.wm.flicker.helpers.closePipWindow import com.android.server.wm.flicker.helpers.closePipWindow import com.android.server.wm.flicker.helpers.hasPipWindow import com.android.server.wm.flicker.helpers.hasPipWindow import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper import com.android.wm.shell.flicker.IME_WINDOW_NAME import com.android.wm.shell.flicker.IME_WINDOW_NAME import com.android.wm.shell.flicker.helpers.ImeAppHelper import com.android.wm.shell.flicker.helpers.ImeAppHelper import com.android.wm.shell.flicker.testapp.Components import org.junit.FixMethodOrder import org.junit.FixMethodOrder import org.junit.Test import org.junit.Test import org.junit.runner.RunWith import org.junit.runner.RunWith Loading @@ -46,6 +48,8 @@ class PipKeyboardTest( rotation: Int rotation: Int ) : PipTestBase(rotationName, rotation) { ) : PipTestBase(rotationName, rotation) { private val keyboardApp = ImeAppHelper(instrumentation) private val keyboardApp = ImeAppHelper(instrumentation) private val keyboardComponent = Components.ImeActivity().componentName private val helper = WindowManagerStateHelper() private val keyboardScenario: FlickerBuilder private val keyboardScenario: FlickerBuilder get() = FlickerBuilder(instrumentation).apply { get() = FlickerBuilder(instrumentation).apply { Loading @@ -64,6 +68,8 @@ class PipKeyboardTest( // UiAutomator doesn't support to launch the multiple Activities in a task. // UiAutomator doesn't support to launch the multiple Activities in a task. // So use launchActivity() for the Keyboard Activity. // So use launchActivity() for the Keyboard Activity. keyboardApp.launchViaIntent() keyboardApp.launchViaIntent() helper.waitForAppTransitionIdle() helper.waitForFullScreenApp(keyboardComponent) } } } } teardown { teardown { Loading @@ -88,9 +94,11 @@ class PipKeyboardTest( transitions { transitions { // open the soft keyboard // open the soft keyboard keyboardApp.openIME() keyboardApp.openIME() helper.waitImeWindowShown() // then close it again // then close it again keyboardApp.closeIME() keyboardApp.closeIME() helper.waitImeWindowGone() } } assertions { assertions { windowManagerTrace { windowManagerTrace { Loading @@ -112,11 +120,13 @@ class PipKeyboardTest( transitions { transitions { // open the soft keyboard // open the soft keyboard keyboardApp.openIME() keyboardApp.openIME() helper.waitImeWindowShown() } } teardown { teardown { eachRun { eachRun { // close the keyboard // close the keyboard keyboardApp.closeIME() keyboardApp.closeIME() helper.waitImeWindowGone() } } } } assertions { assertions { Loading