Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java

Issue 499393002: Set the Insertion handle correctly while showing the paste popup menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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", "Main"})
545 public void testPastePopupShowOnLongPress() throws Throwable {
546 DOMUtils.focusNode(mContentViewCore, "input_radio");
547 assertWaitForKeyboardStatus(false);
548
549 DOMUtils.focusNode(mContentViewCore, "input_text");
550 assertWaitForKeyboardStatus(true);
551
552 mConnection = (TestAdapterInputConnection) getAdapterInputConnection();
553
554 commitText(mConnection, "hello", 1);
555 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "hello", 5 , 5, -1, -1);
556
557 selectAll(mImeAdapter);
558 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "hello", 0 , 5, -1, -1);
559
560 cut(mImeAdapter);
561 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 0, "", 0, 0, -1, -1);
562
563 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
564 PastePopupMenu pastePopup = mContentViewCore.getPastePopupForTest();
jdduke (slow) 2014/08/25 17:40:45 Don't you need to wait here? I'm not sure that DOM
raghu 2014/08/26 07:23:31 Done.
565 assertTrue(pastePopup.isShowing());
566 }
567
543 private void performGo(final AdapterInputConnection inputConnection, 568 private void performGo(final AdapterInputConnection inputConnection,
544 TestCallbackHelperContainer testCallbackHelperContainer) throws Thro wable { 569 TestCallbackHelperContainer testCallbackHelperContainer) throws Thro wable {
545 handleBlockingCallbackAction( 570 handleBlockingCallbackAction(
546 testCallbackHelperContainer.getOnPageFinishedHelper(), 571 testCallbackHelperContainer.getOnPageFinishedHelper(),
547 new Runnable() { 572 new Runnable() {
548 @Override 573 @Override
549 public void run() { 574 public void run() {
550 inputConnection.performEditorAction(EditorInfo.IME_ACTIO N_GO); 575 inputConnection.performEditorAction(EditorInfo.IME_ACTIO N_GO);
551 } 576 }
552 }); 577 });
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 public void assertEqualState(String text, int selectionStart, int select ionEnd, 795 public void assertEqualState(String text, int selectionStart, int select ionEnd,
771 int compositionStart, int compositionEnd) { 796 int compositionStart, int compositionEnd) {
772 assertEquals("Text did not match", text, mText); 797 assertEquals("Text did not match", text, mText);
773 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); 798 assertEquals("Selection start did not match", selectionStart, mSelec tionStart);
774 assertEquals("Selection end did not match", selectionEnd, mSelection End); 799 assertEquals("Selection end did not match", selectionEnd, mSelection End);
775 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); 800 assertEquals("Composition start did not match", compositionStart, mC ompositionStart);
776 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); 801 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd);
777 } 802 }
778 } 803 }
779 } 804 }
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698