From f5f5fb4b6442f5a67ab5c4fb5610d4c8dff3d2b7 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Wed, 6 Aug 2014 23:57:03 +0000 Subject: Revert "Introduce onEvent() to improve testability" This reverts commit ef74e737f580f7ac0b3bd70d6255dde3c87d9078. Apparently, this CL broke several unit tests. Change-Id: I86cf5f1ffb0214707afe99ee97f92ba8c5157f3f --- tests/src/com/android/inputmethod/latin/InputTestsBase.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java') diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index 18671fbe8..986fb1097 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -36,7 +36,6 @@ import android.widget.EditText; import android.widget.FrameLayout; import com.android.inputmethod.compat.InputMethodSubtypeCompatUtils; -import com.android.inputmethod.event.Event; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; @@ -264,17 +263,14 @@ public class InputTestsBase extends ServiceTestCase { // but keep them in mind if something breaks. Commenting them out as is should work. //mLatinIME.onPressKey(codePoint, 0 /* repeatCount */, true /* isSinglePointer */); final Key key = mKeyboard.getKey(codePoint); - final Event event; if (key == null) { - event = Event.createSoftwareKeypressEvent(codePoint, Event.NOT_A_KEY_CODE, - Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, isKeyRepeat); + mLatinIME.onCodeInput(codePoint, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, + isKeyRepeat); } else { final int x = key.getX() + key.getWidth() / 2; final int y = key.getY() + key.getHeight() / 2; - event = Event.createSoftwareKeypressEvent(codePoint, Event.NOT_A_KEY_CODE, - x, y, isKeyRepeat); + mLatinIME.onCodeInput(codePoint, x, y, isKeyRepeat); } - mLatinIME.onEvent(event); // Also see the comment at the top of this function about onReleaseKey //mLatinIME.onReleaseKey(codePoint, false /* withSliding */); } -- cgit v1.2.3-83-g751a