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 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"}) | |
210 public void testImeCut() throws Exception { | 187 public void testImeCut() throws Exception { |
211 commitText(mConnection, "snarful", 1); | 188 commitText(mConnection, "snarful", 1); |
212 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful",
7, 7, -1, -1); | 189 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful",
7, 7, -1, -1); |
213 | 190 |
214 setSelection(mConnection, 1, 5); | 191 setSelection(mConnection, 1, 5); |
215 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful",
1, 5, -1, -1); | 192 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful",
1, 5, -1, -1); |
216 | 193 |
217 cut(mImeAdapter); | 194 cut(mImeAdapter); |
218 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1,
1, -1, -1); | 195 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1,
1, -1, -1); |
219 | 196 |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 public void assertEqualState(String text, int selectionStart, int select
ionEnd, | 790 public void assertEqualState(String text, int selectionStart, int select
ionEnd, |
814 int compositionStart, int compositionEnd) { | 791 int compositionStart, int compositionEnd) { |
815 assertEquals("Text did not match", text, mText); | 792 assertEquals("Text did not match", text, mText); |
816 assertEquals("Selection start did not match", selectionStart, mSelec
tionStart); | 793 assertEquals("Selection start did not match", selectionStart, mSelec
tionStart); |
817 assertEquals("Selection end did not match", selectionEnd, mSelection
End); | 794 assertEquals("Selection end did not match", selectionEnd, mSelection
End); |
818 assertEquals("Composition start did not match", compositionStart, mC
ompositionStart); | 795 assertEquals("Composition start did not match", compositionStart, mC
ompositionStart); |
819 assertEquals("Composition end did not match", compositionEnd, mCompo
sitionEnd); | 796 assertEquals("Composition end did not match", compositionEnd, mCompo
sitionEnd); |
820 } | 797 } |
821 } | 798 } |
822 } | 799 } |
OLD | NEW |