DescriptionPrevent real IME from interfering with UrlBarTest
Android framework does not provide an easy way to remove keyboard app
from the testing (unless you use Robolectric).
So far we have been allowing the current keyboard app to interfere with
test and thus flaked test results. Especially, when you make selection
change, Google Latin Keyboard tries to look at the new status by running
beginBatchEdit() -> getTextBeforeCursor() -> endBatchEdit().
And this disrupted batch edit logic such as mInBatchEditMode.
With this change, onCreateInputConnection() will now return null, so
keyboard app cannot interact with the text. Also, dispatchKeyEvent
will ignore key events when it has to.
Note that the test can still interact with BaseInputConnection's method
and thus affects EditText's Editable through UrlBar#getInputConnection().
In doing so, I've guarded KeyUtils#dispatchKeyEventToView() to work with
UI thread.
BUG=723901
Review-Url: https://codereview.chromium.org/2894073002
Cr-Commit-Position: refs/heads/master@{#473782}
Committed: https://chromium.googlesource.com/chromium/src/+/bae36d8062ad39d994cdf27a99418ec3fbe5aa13
Patch Set 1 #
Messages
Total messages: 12 (8 generated)
|