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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/input/ImeLollipopTest.java

Issue 2121953002: Do not calculate composition bounds until IME requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test failures Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser.input; 5 package org.chromium.content.browser.input;
6 6
7 import android.annotation.TargetApi; 7 import android.annotation.TargetApi;
8 import android.os.Build; 8 import android.os.Build;
9 import android.test.suitebuilder.annotation.MediumTest; 9 import android.test.suitebuilder.annotation.MediumTest;
10 import android.view.inputmethod.CursorAnchorInfo; 10 import android.view.inputmethod.CursorAnchorInfo;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 // In "IMMEDIATE" mode, even when there's no change, we should be notifi ed at least once. 52 // In "IMMEDIATE" mode, even when there's no change, we should be notifi ed at least once.
53 ThreadUtils.runOnUiThreadBlocking(new Runnable() { 53 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
54 @Override 54 @Override
55 public void run() { 55 public void run() {
56 mInputMethodManagerWrapper.clearLastCursorAnchorInfo(); 56 mInputMethodManagerWrapper.clearLastCursorAnchorInfo();
57 } 57 }
58 }); 58 });
59 requestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE); 59 requestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE);
60 waitForUpdateCursorAnchorInfoComposingText("abcd"); 60 waitForUpdateCursorAnchorInfoComposingText("abcd");
61
62 setComposingText("abcde", 2);
63 requestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE);
64 waitForUpdateCursorAnchorInfoComposingText("abcde");
61 } 65 }
62 66
63 private void requestCursorUpdates(final int cursorUpdateMode) { 67 private void requestCursorUpdates(final int cursorUpdateMode) {
64 final InputConnection connection = mConnection; 68 final InputConnection connection = mConnection;
65 ThreadUtils.runOnUiThreadBlocking(new Runnable() { 69 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
66 @Override 70 @Override
67 public void run() { 71 public void run() {
68 connection.requestCursorUpdates(cursorUpdateMode); 72 connection.requestCursorUpdates(cursorUpdateMode);
69 } 73 }
70 }); 74 });
(...skipping 10 matching lines...) Expand all
81 return false; 85 return false;
82 } 86 }
83 87
84 String actual = (info == null ? "" : info.getComposingText().toS tring()); 88 String actual = (info == null ? "" : info.getComposingText().toS tring());
85 updateFailureReason("Expected: {" + expected + "}, Actual: {" + actual + "}"); 89 updateFailureReason("Expected: {" + expected + "}, Actual: {" + actual + "}");
86 return expected.equals(actual); 90 return expected.equals(actual);
87 } 91 }
88 }); 92 });
89 } 93 }
90 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698