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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java

Issue 2121953002: Do not calculate composition bounds until IME requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 5 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/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java
index 768b6bbf91d2aded5ac6101e705e16983d39a7b4..341dfd1eb9f814c45d2968a1ccbe738c6a683680 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/input/CursorAnchorInfoControllerTest.java
@@ -144,7 +144,7 @@ public class CursorAnchorInfoControllerTest extends InstrumentationTestCase {
controller.onRequestCursorUpdates(InputConnection.CURSOR_UPDATE_MONITOR, view));
// Make sure that the focused node is considered to be non-editable by default.
- controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f});
+ controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view);
composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1);
controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f),
true, true, 2.0f, 0.0f, 3.0f, view);
@@ -155,7 +155,7 @@ public class CursorAnchorInfoControllerTest extends InstrumentationTestCase {
// Make sure that the controller does not crash even if it is called while the focused node
// is not editable.
- controller.setCompositionCharacterBounds(new float[] {30.0f, 1.0f, 32.0f, 3.0f});
+ controller.setCompositionCharacterBounds(new float[] {30.0f, 1.0f, 32.0f, 3.0f}, view);
composingTextDelegate.updateTextAndSelection(controller, "1", 0, 1, 0, 1);
controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 100.0f),
true, true, 2.0f, 0.0f, 3.0f, view);
@@ -181,7 +181,7 @@ public class CursorAnchorInfoControllerTest extends InstrumentationTestCase {
// available with #onUpdateFrameInfo().
assertTrue(controller.onRequestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE,
view));
- controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f});
+ controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view);
composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1);
assertEquals(0, immw.getUpdateCursorAnchorInfoCounter());
controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f),
@@ -290,7 +290,7 @@ public class CursorAnchorInfoControllerTest extends InstrumentationTestCase {
// Make sure that #updateCursorAnchorInfo() is not be called until the matrix info becomes
// available with #onUpdateFrameInfo().
assertTrue(controller.onRequestCursorUpdates(InputConnection.CURSOR_UPDATE_MONITOR, view));
- controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f});
+ controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view);
composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1);
assertEquals(0, immw.getUpdateCursorAnchorInfoCounter());
controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f),
@@ -309,14 +309,14 @@ public class CursorAnchorInfoControllerTest extends InstrumentationTestCase {
// Make sure that #updateCursorAnchorInfo() is not be called if any coordinate parameter is
// changed for better performance.
- controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f});
+ controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view);
controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f),
true, true, 2.0f, 0.0f, 3.0f, view);
assertEquals(1, immw.getUpdateCursorAnchorInfoCounter());
// Make sure that #updateCursorAnchorInfo() is called if #setCompositionCharacterBounds()
// is called with a different parameter.
- controller.setCompositionCharacterBounds(new float[] {30.0f, 1.0f, 32.0f, 3.0f});
+ controller.setCompositionCharacterBounds(new float[] {30.0f, 1.0f, 32.0f, 3.0f}, view);
assertEquals(1, immw.getUpdateCursorAnchorInfoCounter());
controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f),
true, true, 2.0f, 0.0f, 3.0f, view);
@@ -391,7 +391,7 @@ public class CursorAnchorInfoControllerTest extends InstrumentationTestCase {
assertTrue(controller.onRequestCursorUpdates(InputConnection.CURSOR_UPDATE_MONITOR, view));
controller.focusedNodeChanged(false);
composingTextDelegate.clearTextAndSelection(controller);
- controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f});
+ controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view);
composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1);
controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f),
true, true, 2.0f, 0.0f, 3.0f, view);
@@ -401,7 +401,7 @@ public class CursorAnchorInfoControllerTest extends InstrumentationTestCase {
controller.focusedNodeChanged(true);
composingTextDelegate.clearTextAndSelection(controller);
assertTrue(controller.onRequestCursorUpdates(InputConnection.CURSOR_UPDATE_MONITOR, view));
- controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f});
+ controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f}, view);
composingTextDelegate.updateTextAndSelection(controller, "0", 0, 1, 0, 1);
assertEquals(5, immw.getUpdateCursorAnchorInfoCounter());
viewDelegate.locationX = 0;
@@ -440,7 +440,7 @@ public class CursorAnchorInfoControllerTest extends InstrumentationTestCase {
composingTextDelegate.updateTextAndSelection(controller, "01234", 1, 3, 1, 1);
controller.setCompositionCharacterBounds(new float[] {0.0f, 1.0f, 2.0f, 3.0f,
- 4.0f, 1.1f, 6.0f, 2.9f});
+ 4.0f, 1.1f, 6.0f, 2.9f}, view);
controller.onUpdateFrameInfo(createRenderCoordinates(1.0f, 0.0f),
false, false, Float.NaN, Float.NaN, Float.NaN, view);
assertEquals(1, immw.getUpdateCursorAnchorInfoCounter());

Powered by Google App Engine
This is Rietveld 408576698