From 1b95a0179507a4dc7d4b0c94c2df420dc1a72885 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Tue, 14 Jul 2020 13:15:11 +0000 Subject: [PATCH] Bug 1651019 - Check current inputted value to avoid timing issue. r=geckoview-reviewers,esawin To sync Gecko's text with Java text correctly, I would like to add more text and selection check each `InputConnection.setComposingText` call. Differential Revision: https://phabricator.services.mozilla.com/D83464 --- .../mozilla/geckoview/test/TextInputDelegateTest.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TextInputDelegateTest.kt b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TextInputDelegateTest.kt index 7bccc27a8b5c..21aedc1aaf14 100644 --- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TextInputDelegateTest.kt +++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/TextInputDelegateTest.kt @@ -866,10 +866,15 @@ class TextInputDelegateTest : BaseSessionTest() { """) setComposingText(ic, "b", 1) - setComposingText(ic, "a", 1) - pressKey(ic, KeyEvent.KEYCODE_R) + assertTextAndSelectionAt("Don't change caret position after calling blur and focus", + ic, "b", 1) - assertText("Can set composition string after calling blur and focus", + setComposingText(ic, "a", 1) + assertTextAndSelectionAt("Can set composition string after calling blur and focus", + ic, "ba", 2) + + pressKey(ic, KeyEvent.KEYCODE_R) + assertText("Can set input string by keypress after calling blur and focus", ic, "bar") } }