diff options
Diffstat (limited to 'tests/src/com/android/inputmethod/latin')
4 files changed, 13 insertions, 11 deletions
diff --git a/tests/src/com/android/inputmethod/latin/EventRingBufferTests.java b/tests/src/com/android/inputmethod/latin/EventRingBufferTests.java index 869781f3d..a3d2a2b10 100644 --- a/tests/src/com/android/inputmethod/latin/EventRingBufferTests.java +++ b/tests/src/com/android/inputmethod/latin/EventRingBufferTests.java @@ -16,7 +16,7 @@ package com.android.inputmethod.latin; -import com.android.inputmethod.keyboard.SwipeTracker.EventRingBuffer; +import com.android.inputmethod.keyboard.internal.SwipeTracker.EventRingBuffer; import android.test.AndroidTestCase; diff --git a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java index d128cb3fa..d102aa4d1 100644 --- a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java +++ b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java @@ -16,6 +16,8 @@ package com.android.inputmethod.latin; +import com.android.inputmethod.latin.Utils; + import android.content.Context; import android.content.res.Resources; import android.test.AndroidTestCase; @@ -75,7 +77,7 @@ public class SubtypeLocaleTests extends AndroidTestCase { int failedCount = 0; for (final InputMethodSubtype subtype : mKeyboardSubtypes) { final String localeCode = subtype.getLocale(); - final Locale locale = new Locale(localeCode); + final Locale locale = Utils.constructLocaleFromString(localeCode); // The locale name which will be displayed on spacebar. For example 'English (US)' or // 'Francais (Canada)'. (c=\u008d) final String displayName = SubtypeLocale.getFullDisplayName(locale); diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java index 8a11ff955..87ea011fa 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java +++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java @@ -36,7 +36,7 @@ public class SuggestHelper { // Use null as the locale for Suggest so as to force it to use the internal dictionary // (and not try to find a dictionary provider for a specified locale) mSuggest = new Suggest(context, dictionaryId, null); - mKeyboard = new LatinKeyboard(context, keyboardId); + mKeyboard = new LatinKeyboard(context, keyboardId, keyboardId.mWidth); mKeyDetector = new KeyDetector(); init(); } @@ -44,7 +44,7 @@ public class SuggestHelper { protected SuggestHelper(Context context, File dictionaryPath, long startOffset, long length, KeyboardId keyboardId) { mSuggest = new Suggest(context, dictionaryPath, startOffset, length, null); - mKeyboard = new LatinKeyboard(context, keyboardId); + mKeyboard = new LatinKeyboard(context, keyboardId, keyboardId.mWidth); mKeyDetector = new KeyDetector(); init(); } diff --git a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java index 64f26743e..8aadee42e 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java @@ -16,15 +16,14 @@ package com.android.inputmethod.latin; -import com.android.inputmethod.keyboard.KeyboardId; -import com.android.inputmethod.keyboard.KeyboardView; - import android.content.res.AssetFileDescriptor; import android.content.res.Configuration; import android.test.AndroidTestCase; import android.text.TextUtils; import android.view.inputmethod.EditorInfo; +import com.android.inputmethod.keyboard.KeyboardId; + import java.io.File; import java.io.InputStream; import java.util.Locale; @@ -38,11 +37,12 @@ public class SuggestTestsBase extends AndroidTestCase { mTestPackageFile = new File(getTestContext().getApplicationInfo().sourceDir); } - protected static KeyboardId createKeyboardId(Locale locale) { + protected KeyboardId createKeyboardId(Locale locale) { + final int displayWidth = getContext().getResources().getDisplayMetrics().widthPixels; return new KeyboardId(locale.toString() + " keyboard", - com.android.inputmethod.latin.R.xml.kbd_qwerty, KeyboardView.COLOR_SCHEME_WHITE, - locale, Configuration.ORIENTATION_LANDSCAPE, KeyboardId.MODE_TEXT, - new EditorInfo(), false, false, false, false); + com.android.inputmethod.latin.R.xml.kbd_qwerty, locale, + Configuration.ORIENTATION_LANDSCAPE, displayWidth, KeyboardId.MODE_TEXT, + new EditorInfo(), false, KeyboardId.F2KEY_MODE_NONE, false, false, false, false); } protected InputStream openTestRawResource(int resIdInTest) { |