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

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

Issue 1283193002: Clear the selection and insertion flags only upon getting the selection event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added more test code Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
index bb9606456bbf0edb28f5df85f4dd7ebbd1966164..71e83f7af8196b45a3b8ced363d3f0c47ad8c3a6 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
@@ -919,7 +919,7 @@ public class ImeTest extends ContentShellTestBase {
@SmallTest
@Feature({"TextInput"})
- public void testPastePopupShowOnLongPress() throws Throwable {
+ public void testPastePopupShowAndHide() throws Throwable {
commitText("hello", 1);
waitAndVerifyStatesAndCalls(1, "hello", 5, 5, -1, -1);
@@ -937,6 +937,35 @@ public class ImeTest extends ContentShellTestBase {
return pastePopup.isShowing();
}
}));
+
+ DOMUtils.clickNode(this, mContentViewCore, "input_text");
+ assertWaitForKeyboardStatus(true);
+ DOMUtils.longPressNode(this, mContentViewCore, "input_text");
+ setComposingText("h", 1);
+ assertTrue(CriteriaHelper.pollForUIThreadCriteria(new Criteria() {
+ @Override
+ public boolean isSatisfied() {
+ return !pastePopup.isShowing();
+ }
+ }));
+ assertFalse(mContentViewCore.hasInsertion());
+ }
+
+ @SmallTest
+ @Feature({"TextInput"})
+ public void testSelectionClearedOnKeyEvent() throws Throwable {
+ commitText("hello", 1);
+ waitAndVerifyStatesAndCalls(1, "hello", 5, 5, -1, -1);
+
+ DOMUtils.clickNode(this, mContentViewCore, "input_text");
+ assertWaitForKeyboardStatus(true);
+
+ DOMUtils.longPressNode(this, mContentViewCore, "input_text");
+ assertWaitForSelectActionBarStatus(true);
+
+ setComposingText("h", 1);
+ assertWaitForSelectActionBarStatus(false);
+ assertFalse(mContentViewCore.hasSelection());
}
@SmallTest
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698