diff options
author | 2012-09-04 01:25:57 -0700 | |
---|---|---|
committer | 2012-09-04 01:25:57 -0700 | |
commit | 12b78258e6d61afba01966cd67cb756a69a92c47 (patch) | |
tree | 28ee86046b9ebc785bd151a467b8ec0a092719e0 /tests/src/com/android/inputmethod/latin/InputTestsBase.java | |
parent | d78a832c6d22b219e2439a6198a759843c635074 (diff) | |
parent | 1b11da15ea046a8f6f59a5fb9f9239ed12f2319d (diff) | |
download | latinime-12b78258e6d61afba01966cd67cb756a69a92c47.tar.gz latinime-12b78258e6d61afba01966cd67cb756a69a92c47.tar.xz latinime-12b78258e6d61afba01966cd67cb756a69a92c47.zip |
am 1b11da15: Merge "Add a first test for the spell checker" into jb-mr1-dev
* commit '1b11da15ea046a8f6f59a5fb9f9239ed12f2319d':
Add a first test for the spell checker
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputTestsBase.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index ffd95f57a..dfb83fa24 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -51,7 +51,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { protected LatinIME mLatinIME; protected Keyboard mKeyboard; - protected TextView mTextView; + protected MyTextView mTextView; protected InputConnection mInputConnection; private final HashMap<String, InputMethodSubtype> mSubtypeMap = new HashMap<String, InputMethodSubtype>(); @@ -86,6 +86,19 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { return (mSpan instanceof SuggestionSpan) && 0 != (SuggestionSpan.FLAG_AUTO_CORRECTION & ((SuggestionSpan)mSpan).getFlags()); } + public String[] getSuggestions() { + return ((SuggestionSpan)mSpan).getSuggestions(); + } + } + + // A helper class to increase control over the TextView + public static class MyTextView extends TextView { + public MyTextView(final Context c) { + super(c); + } + public void onAttachedToWindow() { + super.onAttachedToWindow(); + } } public InputTestsBase() { @@ -112,7 +125,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { @Override protected void setUp() throws Exception { super.setUp(); - mTextView = new TextView(getContext()); + mTextView = new MyTextView(getContext()); mTextView.setInputType(InputType.TYPE_CLASS_TEXT); mTextView.setEnabled(true); setupService(); |