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

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

Issue 501383002: Adding Select Action Bar Unit test case for input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | no next file » | 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 DOMUtils.focusNode(mContentViewCore, "input_radio"); 167 DOMUtils.focusNode(mContentViewCore, "input_radio");
168 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); 168 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
169 assertWaitForKeyboardStatus(false); 169 assertWaitForKeyboardStatus(false);
170 commitText(mConnection, "Sample Text", 1); 170 commitText(mConnection, "Sample Text", 1);
171 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); 171 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
172 assertWaitForKeyboardStatus(true); 172 assertWaitForKeyboardStatus(true);
173 } 173 }
174 174
175 @SmallTest 175 @SmallTest
176 @Feature({"TextInput"}) 176 @Feature({"TextInput"})
177 public void testSelectActionBarShownOnLongPressingInput() throws Exception {
178 DOMUtils.focusNode(mContentViewCore, "input_radio");
jdduke (slow) 2014/08/26 15:01:46 Why not put this test in ContentViewCoreFocusTest?
AKVT 2014/08/26 15:16:40 ContentViewCoreFocusTest does not holding environm
jdduke (slow) 2014/08/26 15:20:39 I don't have a strong opinion, so I'll defer to au
AKVT 2014/08/26 16:38:12 Thanks for the comments. Without this line DOMUtil
179 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
180 assertWaitForKeyboardStatus(false);
181 assertFalse(mContentViewCore.isSelectActionBarShowing());
182 commitText(mConnection, "Sample Text", 1);
183 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
184 assertWaitForKeyboardStatus(true);
185 assertTrue(mContentViewCore.isSelectActionBarShowing());
186 }
187
188 @SmallTest
189 @Feature({"TextInput"})
177 public void testImeCut() throws Exception { 190 public void testImeCut() throws Exception {
178 commitText(mConnection, "snarful", 1); 191 commitText(mConnection, "snarful", 1);
179 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful", 7, 7, -1, -1); 192 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful", 7, 7, -1, -1);
180 193
181 setSelection(mConnection, 1, 5); 194 setSelection(mConnection, 1, 5);
182 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful", 1, 5, -1, -1); 195 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful", 1, 5, -1, -1);
183 196
184 cut(mImeAdapter); 197 cut(mImeAdapter);
185 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1, 1, -1, -1); 198 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1, 1, -1, -1);
186 199
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 public void assertEqualState(String text, int selectionStart, int select ionEnd, 783 public void assertEqualState(String text, int selectionStart, int select ionEnd,
771 int compositionStart, int compositionEnd) { 784 int compositionStart, int compositionEnd) {
772 assertEquals("Text did not match", text, mText); 785 assertEquals("Text did not match", text, mText);
773 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); 786 assertEquals("Selection start did not match", selectionStart, mSelec tionStart);
774 assertEquals("Selection end did not match", selectionEnd, mSelection End); 787 assertEquals("Selection end did not match", selectionEnd, mSelection End);
775 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); 788 assertEquals("Composition start did not match", compositionStart, mC ompositionStart);
776 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); 789 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd);
777 } 790 }
778 } 791 }
779 } 792 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698