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

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: Added the correct wait condition as per review 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 543
544 // Simulate switch of input fields. 544 // Simulate switch of input fields.
545 finishComposingText(mConnection); 545 finishComposingText(mConnection);
546 546
547 // H 547 // H
548 expectUpdateStateCall(mConnection); 548 expectUpdateStateCall(mConnection);
549 setComposingText(mConnection, "h", 1); 549 setComposingText(mConnection, "h", 1);
550 assertEquals(KeyEvent.KEYCODE_H, mImeAdapter.mLastSyntheticKeyCode); 550 assertEquals(KeyEvent.KEYCODE_H, mImeAdapter.mLastSyntheticKeyCode);
551 } 551 }
552 552
553 @SmallTest
554 @Feature({"TextInput"})
555 public void testPastePopupShowOnLongPress() throws Throwable {
556 commitText(mConnection, "hello", 1);
557 waitAndVerifyEditableCallback(
558 mConnection.mImeUpdateQueue, 1, "hello", 5, 5, -1, -1);
jdduke (slow) 2014/08/27 14:57:13 This line break isn't necessary, neither are the l
raghu 2014/08/27 16:19:50 Done.
559
560 selectAll(mImeAdapter);
561 waitAndVerifyEditableCallback(
562 mConnection.mImeUpdateQueue, 2, "hello", 0, 5, -1, -1);
563
564 cut(mImeAdapter);
565 waitAndVerifyEditableCallback(
566 mConnection.mImeUpdateQueue, 0, "", 0, 0, -1, -1);
567
568 DOMUtils.longPressNode(this, mContentViewCore, "input_text");
569
570 final PastePopupMenu pastePopup =
jdduke (slow) 2014/08/27 14:57:13 Line break is not necessary.
raghu 2014/08/27 16:19:50 Done.
571 mContentViewCore.getPastePopupForTest();
572
573 assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {
574 @Override
575 public boolean isSatisfied() {
576 return pastePopup.isShowing();
577 }
578 }));
579 }
580
553 private void performGo(final AdapterInputConnection inputConnection, 581 private void performGo(final AdapterInputConnection inputConnection,
554 TestCallbackHelperContainer testCallbackHelperContainer) throws Thro wable { 582 TestCallbackHelperContainer testCallbackHelperContainer) throws Thro wable {
555 handleBlockingCallbackAction( 583 handleBlockingCallbackAction(
556 testCallbackHelperContainer.getOnPageFinishedHelper(), 584 testCallbackHelperContainer.getOnPageFinishedHelper(),
557 new Runnable() { 585 new Runnable() {
558 @Override 586 @Override
559 public void run() { 587 public void run() {
560 inputConnection.performEditorAction(EditorInfo.IME_ACTIO N_GO); 588 inputConnection.performEditorAction(EditorInfo.IME_ACTIO N_GO);
561 } 589 }
562 }); 590 });
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 public void assertEqualState(String text, int selectionStart, int select ionEnd, 818 public void assertEqualState(String text, int selectionStart, int select ionEnd,
791 int compositionStart, int compositionEnd) { 819 int compositionStart, int compositionEnd) {
792 assertEquals("Text did not match", text, mText); 820 assertEquals("Text did not match", text, mText);
793 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); 821 assertEquals("Selection start did not match", selectionStart, mSelec tionStart);
794 assertEquals("Selection end did not match", selectionEnd, mSelection End); 822 assertEquals("Selection end did not match", selectionEnd, mSelection End);
795 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); 823 assertEquals("Composition start did not match", compositionStart, mC ompositionStart);
796 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); 824 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd);
797 } 825 }
798 } 826 }
799 } 827 }
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