diff options
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/SuggestTestsBase.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/SuggestTestsBase.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java index 058a3e7c0..73e34ba6f 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java @@ -19,11 +19,12 @@ package com.android.inputmethod.latin; import android.content.res.AssetFileDescriptor; import android.content.res.Configuration; import android.test.AndroidTestCase; +import android.text.InputType; import android.text.TextUtils; import android.util.DisplayMetrics; import android.view.inputmethod.EditorInfo; -import com.android.inputmethod.keyboard.KeyboardId; +import com.android.inputmethod.keyboard.KeyboardSet; import java.io.File; import java.io.InputStream; @@ -38,7 +39,12 @@ public class SuggestTestsBase extends AndroidTestCase { mTestPackageFile = new File(getTestContext().getApplicationInfo().sourceDir); } - protected KeyboardId createKeyboardId(Locale locale, int orientation) { + protected KeyboardSet createKeyboardSet(Locale locale, int orientation) { + return createKeyboardSet(locale, orientation, false); + } + + protected KeyboardSet createKeyboardSet(Locale locale, int orientation, + boolean touchPositionCorrectionEnabled) { final DisplayMetrics dm = getContext().getResources().getDisplayMetrics(); final int width; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { @@ -50,10 +56,12 @@ public class SuggestTestsBase extends AndroidTestCase { + "orientation=" + orientation); return null; } - return new KeyboardId(locale.toString() + " keyboard", - com.android.inputmethod.latin.R.xml.kbd_qwerty, locale, orientation, width, - KeyboardId.MODE_TEXT, new EditorInfo(), false, KeyboardId.F2KEY_MODE_NONE, - false, false, false); + final EditorInfo editorInfo = new EditorInfo(); + editorInfo.inputType = InputType.TYPE_CLASS_TEXT; + final KeyboardSet.Builder builder = new KeyboardSet.Builder(getContext(), editorInfo); + builder.setScreenGeometry(orientation, width); + builder.setSubtype(locale, true, touchPositionCorrectionEnabled); + return builder.build(); } protected InputStream openTestRawResource(int resIdInTest) { |