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

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: Removed few move unwanted line breaks 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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 566
567 // Simulate switch of input fields. 567 // Simulate switch of input fields.
568 finishComposingText(mConnection); 568 finishComposingText(mConnection);
569 569
570 // H 570 // H
571 expectUpdateStateCall(mConnection); 571 expectUpdateStateCall(mConnection);
572 setComposingText(mConnection, "h", 1); 572 setComposingText(mConnection, "h", 1);
573 assertEquals(KeyEvent.KEYCODE_H, mImeAdapter.mLastSyntheticKeyCode); 573 assertEquals(KeyEvent.KEYCODE_H, mImeAdapter.mLastSyntheticKeyCode);
574 } 574 }
575 575
576 @SmallTest
577 @Feature({"TextInput"})
578 public void testPastePopupShowOnLongPress() throws Throwable {
579 commitText(mConnection, "hello", 1);
580 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 1, "hello", 5 , 5, -1, -1);
581
582 selectAll(mImeAdapter);
583 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 2, "hello", 0 , 5, -1, -1);
584
585 cut(mImeAdapter);
586 waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 0, "", 0, 0, -1, -1);
587
588 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
589 final PastePopupMenu pastePopup = mContentViewCore.getPastePopupForTest( );
590 assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {
591 @Override
592 public boolean isSatisfied() {
593 return pastePopup.isShowing();
594 }
595 }));
596 }
597
576 private void performGo(final AdapterInputConnection inputConnection, 598 private void performGo(final AdapterInputConnection inputConnection,
577 TestCallbackHelperContainer testCallbackHelperContainer) throws Thro wable { 599 TestCallbackHelperContainer testCallbackHelperContainer) throws Thro wable {
578 handleBlockingCallbackAction( 600 handleBlockingCallbackAction(
579 testCallbackHelperContainer.getOnPageFinishedHelper(), 601 testCallbackHelperContainer.getOnPageFinishedHelper(),
580 new Runnable() { 602 new Runnable() {
581 @Override 603 @Override
582 public void run() { 604 public void run() {
583 inputConnection.performEditorAction(EditorInfo.IME_ACTIO N_GO); 605 inputConnection.performEditorAction(EditorInfo.IME_ACTIO N_GO);
584 } 606 }
585 }); 607 });
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 public void assertEqualState(String text, int selectionStart, int select ionEnd, 835 public void assertEqualState(String text, int selectionStart, int select ionEnd,
814 int compositionStart, int compositionEnd) { 836 int compositionStart, int compositionEnd) {
815 assertEquals("Text did not match", text, mText); 837 assertEquals("Text did not match", text, mText);
816 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); 838 assertEquals("Selection start did not match", selectionStart, mSelec tionStart);
817 assertEquals("Selection end did not match", selectionEnd, mSelection End); 839 assertEquals("Selection end did not match", selectionEnd, mSelection End);
818 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); 840 assertEquals("Composition start did not match", compositionStart, mC ompositionStart);
819 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); 841 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd);
820 } 842 }
821 } 843 }
822 } 844 }
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