Chromium Code Reviews| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 commitText(mConnection, "Sample Text", 1); | 151 commitText(mConnection, "Sample Text", 1); |
| 152 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, | 152 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, |
| 153 "Sample Text", 11, 11, -1, -1); | 153 "Sample Text", 11, 11, -1, -1); |
| 154 DOMUtils.clickNode(this, mContentViewCore, "input_text"); | 154 DOMUtils.clickNode(this, mContentViewCore, "input_text"); |
| 155 assertWaitForKeyboardStatus(true); | 155 assertWaitForKeyboardStatus(true); |
| 156 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 156 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
| 157 selectAll(mImeAdapter); | 157 selectAll(mImeAdapter); |
| 158 copy(mImeAdapter); | 158 copy(mImeAdapter); |
| 159 assertWaitForKeyboardStatus(true); | 159 assertWaitForKeyboardStatus(true); |
| 160 assertEquals(11, Selection.getSelectionEnd(mContentViewCore.getEditableF orTest())); | 160 assertEquals(11, Selection.getSelectionEnd(mContentViewCore.getEditableF orTest())); |
| 161 assertEquals(11, Selection.getSelectionEnd(mContentViewCore.getEditableF orTest())); | |
| 162 } | 161 } |
| 163 | 162 |
| 164 @SmallTest | 163 @SmallTest |
| 164 @Feature({"TextInput"}) | |
| 165 public void testImeNotDismissedAfterCutSelection() throws Exception { | |
| 166 commitText(mConnection, "Sample Text", 1); | |
| 167 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, | |
|
jdduke (slow)
2014/08/28 14:59:08
Nit: This can all fit on a single line (Java style
ankit
2014/08/28 15:31:09
@jdduke
Line width is 101 character. While submitt
jdduke (slow)
2014/08/28 15:33:22
Ah, right, I didn't include the indent.
| |
| 168 "Sample Text", 11, 11, -1, -1); | |
| 169 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | |
| 170 assertWaitForSelectActionBarStatus(true); | |
| 171 assertWaitForKeyboardStatus(true); | |
| 172 cut(mImeAdapter); | |
| 173 assertWaitForKeyboardStatus(true); | |
| 174 assertWaitForSelectActionBarStatus(false); | |
| 175 } | |
| 176 | |
| 177 @SmallTest | |
| 165 @Feature({"TextInput"}) | 178 @Feature({"TextInput"}) |
| 166 public void testImeNotShownOnLongPressingEmptyInput() throws Exception { | 179 public void testImeNotShownOnLongPressingEmptyInput() throws Exception { |
| 167 DOMUtils.focusNode(mContentViewCore, "input_radio"); | 180 DOMUtils.focusNode(mContentViewCore, "input_radio"); |
| 168 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 181 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
| 169 assertWaitForKeyboardStatus(false); | 182 assertWaitForKeyboardStatus(false); |
| 170 commitText(mConnection, "Sample Text", 1); | 183 commitText(mConnection, "Sample Text", 1); |
| 171 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | 184 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); |
| 172 assertWaitForKeyboardStatus(true); | 185 assertWaitForKeyboardStatus(true); |
| 173 } | 186 } |
| 174 | 187 |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 790 public void assertEqualState(String text, int selectionStart, int select ionEnd, | 803 public void assertEqualState(String text, int selectionStart, int select ionEnd, |
| 791 int compositionStart, int compositionEnd) { | 804 int compositionStart, int compositionEnd) { |
| 792 assertEquals("Text did not match", text, mText); | 805 assertEquals("Text did not match", text, mText); |
| 793 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); | 806 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); |
| 794 assertEquals("Selection end did not match", selectionEnd, mSelection End); | 807 assertEquals("Selection end did not match", selectionEnd, mSelection End); |
| 795 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); | 808 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); |
| 796 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); | 809 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); |
| 797 } | 810 } |
| 798 } | 811 } |
| 799 } | 812 } |
| OLD | NEW |