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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
533 | 533 |
534 // Simulate switch of input fields. | 534 // Simulate switch of input fields. |
535 finishComposingText(mConnection); | 535 finishComposingText(mConnection); |
536 | 536 |
537 // H | 537 // H |
538 expectUpdateStateCall(mConnection); | 538 expectUpdateStateCall(mConnection); |
539 setComposingText(mConnection, "h", 1); | 539 setComposingText(mConnection, "h", 1); |
540 assertEquals(KeyEvent.KEYCODE_H, mImeAdapter.mLastSyntheticKeyCode); | 540 assertEquals(KeyEvent.KEYCODE_H, mImeAdapter.mLastSyntheticKeyCode); |
541 } | 541 } |
542 | 542 |
543 @SmallTest | |
544 @Feature({"TextInput"}) | |
545 public void testPastePopupShowOnLongPress() throws Throwable { | |
546 commitText(mConnection, "hello", 1); | |
547 waitAndVerifyEditableCallback( | |
548 mConnection.mImeUpdateQueue, 1, "hello", 5, 5, -1, -1); | |
549 | |
550 selectAll(mImeAdapter); | |
551 waitAndVerifyEditableCallback( | |
552 mConnection.mImeUpdateQueue, 2, "hello", 0, 5, -1, -1); | |
553 | |
554 cut(mImeAdapter); | |
555 waitAndVerifyEditableCallback( | |
556 mConnection.mImeUpdateQueue, 0, "", 0, 0, -1, -1); | |
557 | |
558 DOMUtils.focusNode(mContentViewCore, "input_radio"); | |
559 DOMUtils.longPressNode(this, mContentViewCore, "input_text"); | |
560 PastePopupMenu pastePopup = mContentViewCore.getPastePopupForTest(); | |
561 assertWaitForKeyboardStatus(false); | |
jdduke (slow)
2014/08/26 15:06:43
I don't think this is the right wait condition. Th
raghu
2014/08/26 15:45:56
Cut doesnt hide the keyboard. Also in this test si
jdduke (slow)
2014/08/26 16:01:22
If the keyboard status doesn't change, why are you
raghu
2014/08/27 05:06:42
Done.
| |
562 assertTrue(pastePopup.isShowing()); | |
563 } | |
564 | |
543 private void performGo(final AdapterInputConnection inputConnection, | 565 private void performGo(final AdapterInputConnection inputConnection, |
544 TestCallbackHelperContainer testCallbackHelperContainer) throws Thro wable { | 566 TestCallbackHelperContainer testCallbackHelperContainer) throws Thro wable { |
545 handleBlockingCallbackAction( | 567 handleBlockingCallbackAction( |
546 testCallbackHelperContainer.getOnPageFinishedHelper(), | 568 testCallbackHelperContainer.getOnPageFinishedHelper(), |
547 new Runnable() { | 569 new Runnable() { |
548 @Override | 570 @Override |
549 public void run() { | 571 public void run() { |
550 inputConnection.performEditorAction(EditorInfo.IME_ACTIO N_GO); | 572 inputConnection.performEditorAction(EditorInfo.IME_ACTIO N_GO); |
551 } | 573 } |
552 }); | 574 }); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
770 public void assertEqualState(String text, int selectionStart, int select ionEnd, | 792 public void assertEqualState(String text, int selectionStart, int select ionEnd, |
771 int compositionStart, int compositionEnd) { | 793 int compositionStart, int compositionEnd) { |
772 assertEquals("Text did not match", text, mText); | 794 assertEquals("Text did not match", text, mText); |
773 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); | 795 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); |
774 assertEquals("Selection end did not match", selectionEnd, mSelection End); | 796 assertEquals("Selection end did not match", selectionEnd, mSelection End); |
775 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); | 797 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); |
776 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); | 798 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); |
777 } | 799 } |
778 } | 800 } |
779 } | 801 } |
OLD | NEW |