From 1404c1af850236da4fe4ed3825b70cb228a1da5b Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 20 Dec 2013 15:00:44 +0900 Subject: [IL21] Move the workaround utils to a better place. Bug: 8636060 Change-Id: I566f9e109ebcabe3a6a778118434ce79d02d1113 --- tests/src/com/android/inputmethod/latin/InputTestsBase.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (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 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 { 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 { 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(); -- cgit v1.2.3-83-g751a