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; |
11 import android.test.suitebuilder.annotation.MediumTest; | 11 import android.test.suitebuilder.annotation.MediumTest; |
12 import android.test.suitebuilder.annotation.SmallTest; | 12 import android.test.suitebuilder.annotation.SmallTest; |
13 import android.text.Editable; | 13 import android.text.Editable; |
14 import android.text.Selection; | 14 import android.text.Selection; |
15 import android.text.TextUtils; | 15 import android.text.TextUtils; |
16 import android.view.KeyEvent; | 16 import android.view.KeyEvent; |
17 import android.view.View; | 17 import android.view.View; |
18 import android.view.inputmethod.EditorInfo; | 18 import android.view.inputmethod.EditorInfo; |
19 | 19 |
20 import org.chromium.base.ThreadUtils; | 20 import org.chromium.base.ThreadUtils; |
| 21 import org.chromium.base.test.util.DisabledTest; |
21 import org.chromium.base.test.util.Feature; | 22 import org.chromium.base.test.util.Feature; |
22 import org.chromium.base.test.util.UrlUtils; | 23 import org.chromium.base.test.util.UrlUtils; |
23 import org.chromium.content.browser.ContentViewCore; | 24 import org.chromium.content.browser.ContentViewCore; |
24 import org.chromium.content.browser.test.util.Criteria; | 25 import org.chromium.content.browser.test.util.Criteria; |
25 import org.chromium.content.browser.test.util.CriteriaHelper; | 26 import org.chromium.content.browser.test.util.CriteriaHelper; |
26 import org.chromium.content.browser.test.util.DOMUtils; | 27 import org.chromium.content.browser.test.util.DOMUtils; |
27 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; | 28 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; |
28 import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; | 29 import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; |
29 import org.chromium.content_shell_apk.ContentShellTestBase; | 30 import org.chromium.content_shell_apk.ContentShellTestBase; |
30 | 31 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 @SmallTest | 189 @SmallTest |
189 @Feature({"TextInput"}) | 190 @Feature({"TextInput"}) |
190 public void testSelectActionBarShownOnLongPressingInput() throws Exception { | 191 public void testSelectActionBarShownOnLongPressingInput() throws Exception { |
191 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 192 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
192 assertWaitForSelectActionBarStatus(false); | 193 assertWaitForSelectActionBarStatus(false); |
193 commitText(mConnection, "Sample Text", 1); | 194 commitText(mConnection, "Sample Text", 1); |
194 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 195 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
195 assertWaitForSelectActionBarStatus(true); | 196 assertWaitForSelectActionBarStatus(true); |
196 } | 197 } |
197 | 198 |
| 199 /* |
198 @SmallTest | 200 @SmallTest |
199 @Feature({"TextInput"}) | 201 @Feature({"TextInput"}) |
| 202 */ |
| 203 @DisabledTest |
200 public void testSelectActionBarClearedOnTappingInput() throws Exception { | 204 public void testSelectActionBarClearedOnTappingInput() throws Exception { |
201 commitText(mConnection, "Sample Text", 1); | 205 commitText(mConnection, "Sample Text", 1); |
202 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 206 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
203 assertWaitForKeyboardStatus(true); | 207 assertWaitForKeyboardStatus(true); |
204 assertWaitForSelectActionBarStatus(true); | 208 assertWaitForSelectActionBarStatus(true); |
205 DOMUtils.clickNode(this, mContentViewCore, "input_text"); | 209 DOMUtils.clickNode(this, mContentViewCore, "input_text"); |
206 assertWaitForSelectActionBarStatus(false); | 210 assertWaitForSelectActionBarStatus(false); |
207 } | 211 } |
208 | 212 |
209 @SmallTest | 213 @SmallTest |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 public void assertEqualState(String text, int selectionStart, int select
ionEnd, | 915 public void assertEqualState(String text, int selectionStart, int select
ionEnd, |
912 int compositionStart, int compositionEnd) { | 916 int compositionStart, int compositionEnd) { |
913 assertEquals("Text did not match", text, mText); | 917 assertEquals("Text did not match", text, mText); |
914 assertEquals("Selection start did not match", selectionStart, mSelec
tionStart); | 918 assertEquals("Selection start did not match", selectionStart, mSelec
tionStart); |
915 assertEquals("Selection end did not match", selectionEnd, mSelection
End); | 919 assertEquals("Selection end did not match", selectionEnd, mSelection
End); |
916 assertEquals("Composition start did not match", compositionStart, mC
ompositionStart); | 920 assertEquals("Composition start did not match", compositionStart, mC
ompositionStart); |
917 assertEquals("Composition end did not match", compositionEnd, mCompo
sitionEnd); | 921 assertEquals("Composition end did not match", compositionEnd, mCompo
sitionEnd); |
918 } | 922 } |
919 } | 923 } |
920 } | 924 } |
OLD | NEW |