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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 623 dispatchKeyEvent( | 623 dispatchKeyEvent( |
| 624 mConnection, new KeyEvent( | 624 mConnection, new KeyEvent( |
| 625 0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_I, 0, KeyEv ent.META_ALT_ON)); | 625 0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_I, 0, KeyEv ent.META_ALT_ON)); |
| 626 dispatchKeyEvent( | 626 dispatchKeyEvent( |
| 627 mConnection, new KeyEvent( | 627 mConnection, new KeyEvent( |
| 628 0, 0, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_I, 0, KeyEven t.META_ALT_ON)); | 628 0, 0, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_I, 0, KeyEven t.META_ALT_ON)); |
| 629 assertEquals("hiˆ", mConnection.getTextBeforeCursor(9, 0)); | 629 assertEquals("hiˆ", mConnection.getTextBeforeCursor(9, 0)); |
| 630 | 630 |
| 631 // O (accented key) | 631 // O (accented key) |
| 632 dispatchKeyEvent(mConnection, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEven t.KEYCODE_O)); | 632 dispatchKeyEvent(mConnection, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEven t.KEYCODE_O)); |
| 633 assertUpdateStateCall(mConnection, 1000); | |
|
aurimas (slooooooooow)
2015/01/06 21:12:39
What is the reason we no longer get this update?
bcwhite
2015/01/06 22:08:30
The update state wasn't being cleared in the test
| |
| 634 assertEquals("hi", mConnection.getTextBeforeCursor(9, 0)); | 633 assertEquals("hi", mConnection.getTextBeforeCursor(9, 0)); |
| 635 dispatchKeyEvent(mConnection, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent. KEYCODE_O)); | 634 dispatchKeyEvent(mConnection, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent. KEYCODE_O)); |
| 636 assertEquals("hiô", mConnection.getTextBeforeCursor(9, 0)); | 635 assertEquals("hiô", mConnection.getTextBeforeCursor(9, 0)); |
| 637 } | 636 } |
| 638 | 637 |
| 639 @SmallTest | 638 @SmallTest |
| 640 @Feature({"TextInput", "Main"}) | 639 @Feature({"TextInput", "Main"}) |
| 641 public void testSetComposingRegionOutOfBounds() throws Throwable { | 640 public void testSetComposingRegionOutOfBounds() throws Throwable { |
| 642 DOMUtils.focusNode(mWebContents, "textarea"); | 641 DOMUtils.focusNode(mWebContents, "textarea"); |
| 643 assertWaitForKeyboardStatus(true); | 642 assertWaitForKeyboardStatus(true); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1011 public void assertEqualState(String text, int selectionStart, int select ionEnd, | 1010 public void assertEqualState(String text, int selectionStart, int select ionEnd, |
| 1012 int compositionStart, int compositionEnd) { | 1011 int compositionStart, int compositionEnd) { |
| 1013 assertEquals("Text did not match", text, mText); | 1012 assertEquals("Text did not match", text, mText); |
| 1014 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); | 1013 assertEquals("Selection start did not match", selectionStart, mSelec tionStart); |
| 1015 assertEquals("Selection end did not match", selectionEnd, mSelection End); | 1014 assertEquals("Selection end did not match", selectionEnd, mSelection End); |
| 1016 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); | 1015 assertEquals("Composition start did not match", compositionStart, mC ompositionStart); |
| 1017 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); | 1016 assertEquals("Composition end did not match", compositionEnd, mCompo sitionEnd); |
| 1018 } | 1017 } |
| 1019 } | 1018 } |
| 1020 } | 1019 } |
| OLD | NEW |