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

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

Issue 506423003: Adding Select Action Bar Unit test case for input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits and review comments. 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 public void testSelectActionBarShownOnLongPressingInput() throws Exception { 177 public void testSelectActionBarShownOnLongPressingInput() throws Exception {
178 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); 178 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
179 assertWaitForSelectActionBarStatus(false); 179 assertWaitForSelectActionBarStatus(false);
180 commitText(mConnection, "Sample Text", 1); 180 commitText(mConnection, "Sample Text", 1);
181 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); 181 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
182 assertWaitForSelectActionBarStatus(true); 182 assertWaitForSelectActionBarStatus(true);
183 } 183 }
184 184
185 @SmallTest 185 @SmallTest
186 @Feature({"TextInput"}) 186 @Feature({"TextInput"})
187 public void testSelectActionBarClearedOnTappingInput() throws Exception {
188 commitText(mConnection, "Sample Text", 1);
189 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
190 assertWaitForKeyboardStatus(true);
191 assertWaitForSelectActionBarStatus(true);
192 DOMUtils.clickNode(this, mContentViewCore, "input_text");
193 assertWaitForSelectActionBarStatus(false);
194 }
195
196 @SmallTest
197 @Feature({"TextInput"})
198 public void testSelectActionBarClearedOnTappingOutsideInput() throws Excepti on {
199 commitText(mConnection, "Sample Text", 1);
200 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
201 assertWaitForKeyboardStatus(true);
202 assertWaitForSelectActionBarStatus(true);
203 DOMUtils.clickNode(this, mContentViewCore, "input_radio");
204 assertWaitForKeyboardStatus(false);
205 assertWaitForSelectActionBarStatus(false);
206 }
207
208 @SmallTest
209 @Feature({"TextInput"})
187 public void testImeCut() throws Exception { 210 public void testImeCut() throws Exception {
188 commitText(mConnection, "snarful", 1); 211 commitText(mConnection, "snarful", 1);
189 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful", 7, 7, -1, -1); 212 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful", 7, 7, -1, -1);
190 213
191 setSelection(mConnection, 1, 5); 214 setSelection(mConnection, 1, 5);
192 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful", 1, 5, -1, -1); 215 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful", 1, 5, -1, -1);
193 216
194 cut(mImeAdapter); 217 cut(mImeAdapter);
195 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1, 1, -1, -1); 218 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1, 1, -1, -1);
196 219
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 public void assertEqualState(String text, int selectionStart, int select ionEnd, 813 public void assertEqualState(String text, int selectionStart, int select ionEnd,
791 int compositionStart, int compositionEnd) { 814 int compositionStart, int compositionEnd) {
792 assertEquals("Text did not match", text, mText); 815 assertEquals("Text did not match", text, mText);
793 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); 816 assertEquals("Selection start did not match", selectionStart, mSelec tionStart);
794 assertEquals("Selection end did not match", selectionEnd, mSelection End); 817 assertEquals("Selection end did not match", selectionEnd, mSelection End);
795 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); 818 assertEquals("Composition start did not match", compositionStart, mC ompositionStart);
796 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); 819 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd);
797 } 820 }
798 } 821 }
799 } 822 }
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