| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 DOMUtils.focusNode(mWebContents, "textarea"); | 245 DOMUtils.focusNode(mWebContents, "textarea"); |
| 246 commitText(mConnection, "Sample Text", 1); | 246 commitText(mConnection, "Sample Text", 1); |
| 247 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 247 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
| 248 assertWaitForKeyboardStatus(true); | 248 assertWaitForKeyboardStatus(true); |
| 249 DOMUtils.longPressNode(this, mContentViewCore, "textarea"); | 249 DOMUtils.longPressNode(this, mContentViewCore, "textarea"); |
| 250 assertWaitForKeyboardStatus(true); | 250 assertWaitForKeyboardStatus(true); |
| 251 } | 251 } |
| 252 | 252 |
| 253 @SmallTest | 253 @SmallTest |
| 254 @Feature({"TextInput"}) | 254 @Feature({"TextInput"}) |
| 255 public void testImeStaysOnSwitchingBetweenNonEmptyAndIEmptynputs() throws Ex
ception { |
| 256 DOMUtils.focusNode(mWebContents, "input_radio"); |
| 257 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
| 258 assertWaitForKeyboardStatus(false); |
| 259 DOMUtils.focusNode(mWebContents, "textarea"); |
| 260 commitText(mConnection, "Sample Text", 1); |
| 261 DOMUtils.longPressNode(this, mContentViewCore, "textarea"); |
| 262 assertWaitForKeyboardStatus(true); |
| 263 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
| 264 assertWaitForKeyboardStatus(true); |
| 265 } |
| 266 |
| 267 @SmallTest |
| 268 @Feature({"TextInput"}) |
| 255 public void testImeCut() throws Exception { | 269 public void testImeCut() throws Exception { |
| 256 commitText(mConnection, "snarful", 1); | 270 commitText(mConnection, "snarful", 1); |
| 257 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful",
7, 7, -1, -1); | 271 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "snarful",
7, 7, -1, -1); |
| 258 | 272 |
| 259 setSelection(mConnection, 1, 5); | 273 setSelection(mConnection, 1, 5); |
| 260 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful",
1, 5, -1, -1); | 274 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "snarful",
1, 5, -1, -1); |
| 261 | 275 |
| 262 cut(mImeAdapter); | 276 cut(mImeAdapter); |
| 263 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1,
1, -1, -1); | 277 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 3, "sul", 1,
1, -1, -1); |
| 264 | 278 |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 public void assertEqualState(String text, int selectionStart, int select
ionEnd, | 975 public void assertEqualState(String text, int selectionStart, int select
ionEnd, |
| 962 int compositionStart, int compositionEnd) { | 976 int compositionStart, int compositionEnd) { |
| 963 assertEquals("Text did not match", text, mText); | 977 assertEquals("Text did not match", text, mText); |
| 964 assertEquals("Selection start did not match", selectionStart, mSelec
tionStart); | 978 assertEquals("Selection start did not match", selectionStart, mSelec
tionStart); |
| 965 assertEquals("Selection end did not match", selectionEnd, mSelection
End); | 979 assertEquals("Selection end did not match", selectionEnd, mSelection
End); |
| 966 assertEquals("Composition start did not match", compositionStart, mC
ompositionStart); | 980 assertEquals("Composition start did not match", compositionStart, mC
ompositionStart); |
| 967 assertEquals("Composition end did not match", compositionEnd, mCompo
sitionEnd); | 981 assertEquals("Composition end did not match", compositionEnd, mCompo
sitionEnd); |
| 968 } | 982 } |
| 969 } | 983 } |
| 970 } | 984 } |
| OLD | NEW |