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

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

Issue 660343003: Fixed the insertion handle showing issue on readonly element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the review comments. Created 6 years, 2 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/ContentViewCoreSelectionTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java
index 50d0b4c68c784b8ef18f625374b31d38af68742f..a21dca6554ee2cd18832d8af1501b81435ddbf9a 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java
@@ -32,6 +32,8 @@ public class ContentViewCoreSelectionTest extends ContentShellTestBase {
"<br/><input id=\"input_text\" type=\"text\" value=\"Sample Text\" />" +
"<br/><textarea id=\"empty_textarea\" rows=\"2\" cols=\"20\"></textarea>" +
"<br/><textarea id=\"textarea\" rows=\"2\" cols=\"20\">Sample Text</textarea>" +
+ "<br/><input id=\"readonly_text\" type=\"text\" readonly value=\"Sample Text\"/>" +
+ "<br/><input id=\"disabled_text\" type=\"text\" disabled value=\"Sample Text\" />" +
"</form></body></html>");
private ContentViewCore mContentViewCore;
@@ -173,6 +175,30 @@ public class ContentViewCoreSelectionTest extends ContentShellTestBase {
assertWaitForPastePopupStatus(false);
}
+ @SmallTest
+ @Feature({"TextInput"})
+ public void testPastePopupNotShownOnLongPressingReadOnlyInput() throws Throwable {
+ copyStringToClipboard();
+ DOMUtils.longPressNode(this, mContentViewCore, "empty_input_text");
+ assertWaitForPastePopupStatus(true);
+ assertTrue(mContentViewCore.hasInsertion());
+ DOMUtils.longPressNode(this, mContentViewCore, "readonly_text");
+ assertWaitForPastePopupStatus(false);
+ assertFalse(mContentViewCore.hasInsertion());
+ }
+
+ @SmallTest
+ @Feature({"TextInput"})
+ public void testPastePopupNotShownOnLongPressingDisabledInput() throws Throwable {
+ copyStringToClipboard();
+ DOMUtils.longPressNode(this, mContentViewCore, "empty_input_text");
+ assertWaitForPastePopupStatus(true);
+ assertTrue(mContentViewCore.hasInsertion());
+ DOMUtils.longPressNode(this, mContentViewCore, "disabled_text");
+ assertWaitForPastePopupStatus(false);
+ assertFalse(mContentViewCore.hasInsertion());
+ }
+
private void assertWaitForSelectActionBarVisible(
final boolean visible) throws InterruptedException {
assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {

Powered by Google App Engine
This is Rietveld 408576698