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

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

Issue 484653003: Fixed the inconsistent behavior when long pressing on editable area in Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unwanted file from patchset. Created 6 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
« no previous file with comments | « no previous file | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.app.Activity; 7 import android.app.Activity;
8 import android.content.ClipData; 8 import android.content.ClipData;
9 import android.content.ClipboardManager; 9 import android.content.ClipboardManager;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); 156 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
157 selectAll(mImeAdapter); 157 selectAll(mImeAdapter);
158 copy(mImeAdapter); 158 copy(mImeAdapter);
159 assertWaitForKeyboardStatus(true); 159 assertWaitForKeyboardStatus(true);
160 assertEquals(11, Selection.getSelectionEnd(mContentViewCore.getEditableF orTest())); 160 assertEquals(11, Selection.getSelectionEnd(mContentViewCore.getEditableF orTest()));
161 assertEquals(11, Selection.getSelectionEnd(mContentViewCore.getEditableF orTest())); 161 assertEquals(11, Selection.getSelectionEnd(mContentViewCore.getEditableF orTest()));
162 } 162 }
163 163
164 @SmallTest 164 @SmallTest
165 @Feature({"TextInput"}) 165 @Feature({"TextInput"})
166 public void testImeNotShownOnLongPressingEmptyInput() throws Exception {
167 DOMUtils.focusNode(mContentViewCore, "input_radio");
168 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
169 assertWaitForKeyboardStatus(false);
170 commitText(mConnection, "Sample Text", 1);
171 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
172 assertWaitForKeyboardStatus(true);
173 }
174
175 @SmallTest
176 @Feature({"TextInput"})
166 public void testImeCut() throws Exception { 177 public void testImeCut() throws Exception {
167 commitText(mConnection, "snarful", 1); 178 commitText(mConnection, "snarful", 1);
168 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful", 7, 7, -1, -1); 179 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful", 7, 7, -1, -1);
169 180
170 setSelection(mConnection, 1, 5); 181 setSelection(mConnection, 1, 5);
171 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful", 1, 5, -1, -1); 182 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful", 1, 5, -1, -1);
172 183
173 cut(mImeAdapter); 184 cut(mImeAdapter);
174 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1, 1, -1, -1); 185 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1, 1, -1, -1);
175 186
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 public void assertEqualState(String text, int selectionStart, int select ionEnd, 770 public void assertEqualState(String text, int selectionStart, int select ionEnd,
760 int compositionStart, int compositionEnd) { 771 int compositionStart, int compositionEnd) {
761 assertEquals("Text did not match", text, mText); 772 assertEquals("Text did not match", text, mText);
762 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); 773 assertEquals("Selection start did not match", selectionStart, mSelec tionStart);
763 assertEquals("Selection end did not match", selectionEnd, mSelection End); 774 assertEquals("Selection end did not match", selectionEnd, mSelection End);
764 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); 775 assertEquals("Composition start did not match", compositionStart, mC ompositionStart);
765 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); 776 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd);
766 } 777 }
767 } 778 }
768 } 779 }
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698