aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputTestsBase.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-04-02 17:38:24 +0900
committerJean Chalard <jchalard@google.com>2013-04-02 18:20:14 +0900
commit84bfde04216b471407801bf57a31687c4992bca0 (patch)
treee0e5714e6cf8d99569d81f60e926911bf590a9af /tests/src/com/android/inputmethod/latin/InputTestsBase.java
parentecb59eff90c6cfd8d3e6ae31961d7f27f8c9eac9 (diff)
downloadlatinime-84bfde04216b471407801bf57a31687c4992bca0.tar.gz
latinime-84bfde04216b471407801bf57a31687c4992bca0.tar.xz
latinime-84bfde04216b471407801bf57a31687c4992bca0.zip
Fix a test.
The test was not passing the correct input type when it was creating the text view, resulting in mismatched types seen from TextView and LatinIME with some bad results. The test would even go as far as restoring it after it's been fixed by TextView. Additionally, since we want to enter litteral carriage returns, the input type should be MULTI_LINE. If not, TextView does not allow carriage returns. Bug: 8302690 Change-Id: I1c20bcf6ca554ad981048ec181e19c649f6c742e
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputTestsBase.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
index 4ccbf4857..d0ab841ae 100644
--- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java
+++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
@@ -130,7 +130,9 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> {
protected void setUp() throws Exception {
super.setUp();
mTextView = new MyTextView(getContext());
- mTextView.setInputType(InputType.TYPE_CLASS_TEXT);
+ final int inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT
+ | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
+ mTextView.setInputType(inputType);
mTextView.setEnabled(true);
setupService();
mLatinIME = getService();
@@ -138,9 +140,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> {
mLatinIME.onCreate();
setDebugMode(previousDebugSetting);
final EditorInfo ei = new EditorInfo();
- ei.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
final InputConnection ic = mTextView.onCreateInputConnection(ei);
- ei.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
final LayoutInflater inflater =
(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final ViewGroup vg = new FrameLayout(getContext());