Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1591)

Unified Diff: content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java

Issue 1801033003: [Android] Pass original unicode character to blink for dead keys (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rewrite unittest and avoid creating KeyEvent Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
diff --git a/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java b/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
index a8e7890913b9d78193209aa1526d10d52d3f9f90..43688db63914d270f3947a784c0eb691b3bd34a9 100644
--- a/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
+++ b/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
@@ -14,6 +14,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.when;
import android.os.Handler;
+import android.view.KeyCharacterMap;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
@@ -53,7 +54,7 @@ public class ThreadedInputConnectionTest {
public void testComposeGetTextFinishGetText() {
// IME app calls setComposingText().
mConnection.setComposingText("hello", 1);
- mInOrder.verify(mImeAdapter).sendCompositionToNative("hello", 1, false);
+ mInOrder.verify(mImeAdapter).sendCompositionToNative("hello", 1, false, 0);
// Renderer updates states asynchronously.
mConnection.updateStateOnUiThread("hello", 5, 5, 0, 5, true, true);
@@ -87,6 +88,17 @@ public class ThreadedInputConnectionTest {
@Test
@Feature({"TextInput"})
+ public void testPressingDeadKey() {
+ // On default keyboard "Alt+i" produces a dead key '\u0302'.
+ mConnection.setCombiningAccent(0x0302);
Yaron 2016/03/23 21:21:04 seems a little whiteboxey but I guess we don't hav
+ mConnection.updateComposingText("\u0302", 1, true);
+ mInOrder.verify(mImeAdapter)
+ .sendCompositionToNative(
+ "\u0302", 1, false, 0x0302 | KeyCharacterMap.COMBINING_ACCENT);
+ }
+
+ @Test
+ @Feature({"TextInput"})
public void testRenderChangeUpdatesSelection() {
// User moves the cursor.
mConnection.updateStateOnUiThread("hello", 4, 4, -1, -1, true, true);
@@ -101,7 +113,7 @@ public class ThreadedInputConnectionTest {
assertTrue(mConnection.beginBatchEdit());
// Type hello real fast.
mConnection.commitText("hello", 1);
- mInOrder.verify(mImeAdapter).sendCompositionToNative("hello", 1, true);
+ mInOrder.verify(mImeAdapter).sendCompositionToNative("hello", 1, true, 0);
// Renderer updates states asynchronously.
mConnection.updateStateOnUiThread("hello", 5, 5, -1, -1, true, true);

Powered by Google App Engine
This is Rietveld 408576698