aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputTestsBase.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-20 15:00:44 +0900
committerJean Chalard <jchalard@google.com>2013-12-20 16:48:54 +0900
commit1404c1af850236da4fe4ed3825b70cb228a1da5b (patch)
treeb8438b4413cd8ce277f49ce57b8db832834d9a87 /tests/src/com/android/inputmethod/latin/InputTestsBase.java
parent8a390023e122e517faca85ed7161c7b67071be93 (diff)
downloadlatinime-1404c1af850236da4fe4ed3825b70cb228a1da5b.tar.gz
latinime-1404c1af850236da4fe4ed3825b70cb228a1da5b.tar.xz
latinime-1404c1af850236da4fe4ed3825b70cb228a1da5b.zip
[IL21] Move the workaround utils to a better place.
Bug: 8636060 Change-Id: I566f9e109ebcabe3a6a778118434ce79d02d1113
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputTestsBase.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
index aaad740e4..cee73c917 100644
--- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java
+++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
@@ -162,6 +162,13 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> {
return setBooleanPreference(PREF_DEBUG_MODE, value, false);
}
+ protected EditorInfo enrichEditorInfo(final EditorInfo ei) {
+ // Some tests that inherit from us need to add some data in the EditorInfo (see
+ // AppWorkaroundsTests#enrichEditorInfo() for a concrete example of this). Since we
+ // control the EditorInfo, we supply a hook here for children to override.
+ return ei;
+ }
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -176,12 +183,13 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> {
mPreviousAutoCorrectSetting = setStringPreference(PREF_AUTO_CORRECTION_THRESHOLD,
DEFAULT_AUTO_CORRECTION_THRESHOLD, DEFAULT_AUTO_CORRECTION_THRESHOLD);
mLatinIME.onCreate();
- final EditorInfo ei = new EditorInfo();
+ EditorInfo ei = new EditorInfo();
final InputConnection ic = mEditText.onCreateInputConnection(ei);
final LayoutInflater inflater =
(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final ViewGroup vg = new FrameLayout(getContext());
mInputView = inflater.inflate(R.layout.input_view, vg);
+ ei = enrichEditorInfo(ei);
mLatinIME.onCreateInputMethodInterface().startInput(ic, ei);
mLatinIME.setInputView(mInputView);
mLatinIME.onBindInput();