Fix LaunchAppShowImeAndDialogThemeAppTest flakiness
Using tapping DialogThemedActivity may possible to get unexpected focus
change to hide the keyboard, also DialogThemedActivity self doesn't set
android:windowSoftInputState=stateUnchanged, that affects the test
verfication that we expeting IME layer should persist visible.
Fix it by adding stateUnchanged softInputState flag, and simply using
UiDevice#pressBack to dismiss dialog without touching unrelated focus
change.
Fix: 215884488
Test: atest LaunchAppShowImeAndDialogThemeAppTest \
--rerun-until-failure 20
Change-Id: I4704dfa531836423dafc3f3ece1d3b80584ae7fa
This commit is contained in:
@@ -67,10 +67,9 @@ class ImeAppAutoFocusHelper @JvmOverloads constructor(
|
||||
val dialog = uiDevice.wait(
|
||||
Until.findObject(By.text("Dialog for test")), FIND_TIMEOUT)
|
||||
|
||||
// Tapping outside of the dialog to dismiss
|
||||
// Pressing back key to dismiss the dialog
|
||||
if (dialog != null) {
|
||||
val dialogBounds = dialog.visibleBounds
|
||||
uiDevice.click(dialogBounds.left, dialogBounds.top - 300)
|
||||
uiDevice.pressBack()
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,5 +36,6 @@
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
<item name="android:windowSoftInputMode">stateUnchanged</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user