OLD | NEW |
---|---|
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 Loading... | |
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 testSelectActionBarClearOnTappingInput() throws Exception { | |
jdduke (slow)
2014/08/27 18:07:12
Nit: "ActionBarCleared" instead of "ActionBarClear
AKVT
2014/08/27 18:19:41
Done.
| |
188 commitText(mConnection, "Sample Text", 1); | |
jdduke (slow)
2014/08/27 18:07:12
These tests aren't really IME-specific. What if w
AKVT
2014/08/27 18:19:40
Thanks jdduke for the suggestion. Actually I have
| |
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 testSelectActionBarClearOnTappingOutsideInput() throws Exception { | |
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 Loading... | |
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 } |
OLD | NEW |