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

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

Issue 188023002: Android-side of insertion/selection handles visibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments + rebased Created 6 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/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java
index 7cdbd89b0596d830cd63d286464249a4afa500b6..c83a20e81e6ab78586dad931474e63314686dfff 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java
@@ -209,6 +209,35 @@ public class InsertionHandleTest extends ContentShellTestBase {
assertTrue(handle.getPositionX() < dragToX - 100);
}
+ /**
+ * Tests insertion handle visibility relative to the clipping rectangle.
+ * This is currently not implemented using dragHandleTo, because of issues with
+ * http://crbug.com/169648.
+ */
+ @MediumTest
+ @Feature({"TextSelection", "TextInput", "Main"})
+ public void testInsertionHandleVisiblity() throws Throwable {
+ launchWithUrl(TEXTAREA_DATA_URL);
+ clickNodeToShowInsertionHandle(TEXTAREA_ID);
+
+ InsertionHandleController ihc = getContentViewCore().getInsertionHandleControllerForTest();
+ HandleView handle = ihc.getHandleViewForTest();
+
+ assertTrue(handle.isPositionVisible());
+
+ ihc.setVisibleClippingRectangle(
+ handle.getAdjustedPositionX() + 1, handle.getAdjustedPositionY() + 1,
+ handle.getAdjustedPositionX() + 100, handle.getAdjustedPositionY() + 100);
+
+ assertFalse(handle.isPositionVisible());
+
+ ihc.setVisibleClippingRectangle(
+ handle.getAdjustedPositionX() - 1, handle.getAdjustedPositionY() - 1,
+ handle.getAdjustedPositionX() + 1, handle.getAdjustedPositionY() + 1);
+
+ assertTrue(handle.isPositionVisible());
+ }
+
@Override
protected void tearDown() throws Exception {
super.tearDown();

Powered by Google App Engine
This is Rietveld 408576698