aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelBase.java145
-rw-r--r--tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelKlpTests.java91
-rw-r--r--tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java25
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKey.java15
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyOutput.java24
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyVisual.java84
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyboardBuilder.java2
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/EnglishSplitCustomizer.java35
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsAzerbaijaniAZ.java54
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java17
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TestsTurkish.java48
-rw-r--r--tests/src/com/android/inputmethod/keyboard/layout/tests/TurkicCustomizer.java85
-rw-r--r--tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java4
-rw-r--r--tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java11
-rw-r--r--tests/src/com/android/inputmethod/latin/utils/ImportantNoticeUtilsTests.java222
15 files changed, 561 insertions, 301 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelBase.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelBase.java
index a25d6d6e7..17cee29b3 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelBase.java
@@ -16,12 +16,14 @@
package com.android.inputmethod.keyboard;
+import android.content.Context;
import android.content.res.Resources;
import android.text.InputType;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodSubtype;
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyVisual;
import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.utils.RunInLocale;
import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
@@ -29,28 +31,70 @@ import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
import java.util.Locale;
abstract class KeyboardLayoutSetActionLabelBase extends KeyboardLayoutSetTestsBase {
+ static class ExpectedActionKey {
+ static ExpectedActionKey newIconKey(final String iconName) {
+ final int iconId = KeyboardIconsSet.getIconId(iconName);
+ return new ExpectedActionKey(ExpectedKeyVisual.newInstance(iconId));
+ }
+
+ static ExpectedActionKey newLabelKey(final String label) {
+ return new ExpectedActionKey(ExpectedKeyVisual.newInstance(label));
+ }
+
+ static ExpectedActionKey newLabelKey(final int labelResId,
+ final Locale labelLocale, final Context context) {
+ final RunInLocale<String> getString = new RunInLocale<String>() {
+ @Override
+ protected String job(final Resources res) {
+ return res.getString(labelResId);
+ }
+ };
+ return newLabelKey(getString.runInLocale(context.getResources(), labelLocale));
+ }
+
+ private final ExpectedKeyVisual mVisual;
+
+ private ExpectedActionKey(final ExpectedKeyVisual visual) {
+ mVisual = visual;
+ }
+
+ public int getIconId() { return mVisual.getIconId(); }
+
+ public String getLabel() { return mVisual.getLabel(); }
+ }
+
+ protected static Locale getLabelLocale(final InputMethodSubtype subtype) {
+ if (subtype.getLocale().equals(SubtypeLocaleUtils.NO_LANGUAGE)) {
+ return null;
+ }
+ return SubtypeLocaleUtils.getSubtypeLocale(subtype);
+ }
+
public void testActionUnspecified() {
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_ENTER_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "unspecifiled "
+ SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyIcon(tag, subtype, EditorInfo.IME_ACTION_UNSPECIFIED,
- KeyboardIconsSet.NAME_ENTER_KEY);
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_UNSPECIFIED, expectedKey);
}
}
public void testActionNone() {
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_ENTER_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "none " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyIcon(tag, subtype, EditorInfo.IME_ACTION_NONE,
- KeyboardIconsSet.NAME_ENTER_KEY);
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NONE, expectedKey);
}
}
public void testActionSearch() {
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_SEARCH_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "search " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyIcon(tag, subtype, EditorInfo.IME_ACTION_SEARCH,
- KeyboardIconsSet.NAME_SEARCH_KEY);
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEARCH, expectedKey);
}
}
@@ -63,94 +107,47 @@ abstract class KeyboardLayoutSetActionLabelBase extends KeyboardLayoutSetTestsBa
public void testActionCustom() {
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "custom " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- final CharSequence customLabel = "customLabel";
final EditorInfo editorInfo = new EditorInfo();
editorInfo.imeOptions = EditorInfo.IME_ACTION_UNSPECIFIED;
- editorInfo.actionLabel = customLabel;
- doTestActionKeyLabel(tag, subtype, editorInfo, customLabel);
+ editorInfo.actionLabel = "customLabel";
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey("customLabel");
+ doTestActionKey(tag, subtype, editorInfo, expectedKey);
}
}
- private static void doTestActionKey(final String tag, final KeyboardLayoutSet layoutSet,
- final int elementId, final CharSequence label, final int iconId) {
+ private static void assertActionKey(final String tag, final KeyboardLayoutSet layoutSet,
+ final int elementId, final ExpectedActionKey expectedKey) {
final Keyboard keyboard = layoutSet.getKeyboard(elementId);
- final Key enterKey = keyboard.getKey(Constants.CODE_ENTER);
- assertNotNull(tag + " enter key on " + keyboard.mId, enterKey);
- assertEquals(tag + " enter label " + enterKey, label, enterKey.getLabel());
- assertEquals(tag + " enter icon " + enterKey, iconId, enterKey.getIconId());
+ final Key actualKey = keyboard.getKey(Constants.CODE_ENTER);
+ assertNotNull(tag + " enter key on " + keyboard.mId, actualKey);
+ assertEquals(tag + " label " + expectedKey, expectedKey.getLabel(), actualKey.getLabel());
+ assertEquals(tag + " icon " + expectedKey, expectedKey.getIconId(), actualKey.getIconId());
}
- protected void doTestActionKeyLabelResId(final String tag, final InputMethodSubtype subtype,
- final int actionId, final int labelResId) {
- final Locale labelLocale = subtype.getLocale().equals(SubtypeLocaleUtils.NO_LANGUAGE)
- ? null : SubtypeLocaleUtils.getSubtypeLocale(subtype);
- doTestActionKeyLabelResIdInLocale(tag, subtype, actionId, labelLocale, labelResId);
- }
-
- protected void doTestActionKeyLabelResIdInLocale(final String tag,
- final InputMethodSubtype subtype, final int actionId, final Locale labelLocale,
- final int labelResId) {
+ protected void doTestActionKey(final String tag, final InputMethodSubtype subtype,
+ final int actionId, final ExpectedActionKey expectedKey) {
final EditorInfo editorInfo = new EditorInfo();
editorInfo.imeOptions = actionId;
- final RunInLocale<String> job = new RunInLocale<String>() {
- @Override
- protected String job(final Resources res) {
- return res.getString(labelResId);
- }
- };
- final String label = job.runInLocale(getContext().getResources(), labelLocale);
- doTestActionKeyLabel(tag, subtype, editorInfo, label);
- }
-
- protected void doTestActionKeyLabel(final String tag, final InputMethodSubtype subtype,
- final EditorInfo editorInfo, final CharSequence label) {
- // Test text layouts.
- editorInfo.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
- final KeyboardLayoutSet layoutSet = createKeyboardLayoutSet(subtype, editorInfo);
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_ALPHABET,
- label, KeyboardIconsSet.ICON_UNDEFINED);
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS,
- label, KeyboardIconsSet.ICON_UNDEFINED);
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS_SHIFTED,
- label, KeyboardIconsSet.ICON_UNDEFINED);
- // Test phone number layouts.
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE,
- label, KeyboardIconsSet.ICON_UNDEFINED);
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE_SYMBOLS,
- label, KeyboardIconsSet.ICON_UNDEFINED);
- // Test normal number layout.
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_NUMBER,
- label, KeyboardIconsSet.ICON_UNDEFINED);
- // Test number password layouts.
- editorInfo.inputType =
- InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD;
- final KeyboardLayoutSet passwordSet = createKeyboardLayoutSet(subtype, editorInfo);
- doTestActionKey(tag, passwordSet, KeyboardId.ELEMENT_NUMBER,
- label, KeyboardIconsSet.ICON_UNDEFINED);
+ doTestActionKey(tag, subtype, editorInfo, expectedKey);
}
- protected void doTestActionKeyIcon(final String tag, final InputMethodSubtype subtype,
- final int actionId, final String iconName) {
- final int iconId = KeyboardIconsSet.getIconId(iconName);
- final EditorInfo editorInfo = new EditorInfo();
- editorInfo.imeOptions = actionId;
+ protected void doTestActionKey(final String tag, final InputMethodSubtype subtype,
+ final EditorInfo editorInfo, final ExpectedActionKey expectedKey) {
// Test text layouts.
editorInfo.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL;
final KeyboardLayoutSet layoutSet = createKeyboardLayoutSet(subtype, editorInfo);
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_ALPHABET, null /* label */, iconId);
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS, null /* label */, iconId);
- doTestActionKey(
- tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS_SHIFTED, null /* label */, iconId);
+ assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_ALPHABET, expectedKey);
+ assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS, expectedKey);
+ assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_SYMBOLS_SHIFTED, expectedKey);
// Test phone number layouts.
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE, null /* label */, iconId);
- doTestActionKey(
- tag, layoutSet, KeyboardId.ELEMENT_PHONE_SYMBOLS, null /* label */, iconId);
+ assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE, expectedKey);
+ assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_PHONE_SYMBOLS, expectedKey);
// Test normal number layout.
- doTestActionKey(tag, layoutSet, KeyboardId.ELEMENT_NUMBER, null /* label */, iconId);
+ assertActionKey(tag, layoutSet, KeyboardId.ELEMENT_NUMBER, expectedKey);
// Test number password layout.
editorInfo.inputType =
InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD;
final KeyboardLayoutSet passwordSet = createKeyboardLayoutSet(subtype, editorInfo);
- doTestActionKey(tag, passwordSet, KeyboardId.ELEMENT_NUMBER, null /* label */, iconId);
+ assertActionKey(tag, passwordSet, KeyboardId.ELEMENT_NUMBER, expectedKey);
}
}
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelKlpTests.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelKlpTests.java
index 322a344ff..07d47053a 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelKlpTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelKlpTests.java
@@ -40,8 +40,9 @@ public class KeyboardLayoutSetActionLabelKlpTests extends KeyboardLayoutSetActio
public void testActionGo() {
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "go " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyLabelResId(tag, subtype, EditorInfo.IME_ACTION_GO,
- R.string.label_go_key);
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+ R.string.label_go_key, getLabelLocale(subtype), getContext());
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_GO, expectedKey);
}
}
@@ -49,8 +50,9 @@ public class KeyboardLayoutSetActionLabelKlpTests extends KeyboardLayoutSetActio
public void testActionSend() {
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "send " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyLabelResId(tag, subtype, EditorInfo.IME_ACTION_SEND,
- R.string.label_send_key);
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+ R.string.label_send_key, getLabelLocale(subtype), getContext());
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEND, expectedKey);
}
}
@@ -58,8 +60,9 @@ public class KeyboardLayoutSetActionLabelKlpTests extends KeyboardLayoutSetActio
public void testActionNext() {
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "next " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyLabelResId(tag, subtype, EditorInfo.IME_ACTION_NEXT,
- R.string.label_next_key);
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+ R.string.label_next_key, getLabelLocale(subtype), getContext());
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NEXT, expectedKey);
}
}
@@ -67,8 +70,9 @@ public class KeyboardLayoutSetActionLabelKlpTests extends KeyboardLayoutSetActio
public void testActionDone() {
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "done " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyLabelResId(tag, subtype, EditorInfo.IME_ACTION_DONE,
- R.string.label_done_key);
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+ R.string.label_done_key, getLabelLocale(subtype), getContext());
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_DONE, expectedKey);
}
}
@@ -76,42 +80,59 @@ public class KeyboardLayoutSetActionLabelKlpTests extends KeyboardLayoutSetActio
public void testActionPrevious() {
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "previous " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyLabelResId(tag, subtype, EditorInfo.IME_ACTION_PREVIOUS,
- R.string.label_previous_key);
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+ R.string.label_previous_key, getLabelLocale(subtype), getContext());
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_PREVIOUS, expectedKey);
}
}
+ private void doTestActionKeys(final InputMethodSubtype subtype, final String tag,
+ final ExpectedActionKey unspecifiedKey, final ExpectedActionKey noneKey,
+ final ExpectedActionKey goKey, final ExpectedActionKey searchKey,
+ final ExpectedActionKey sendKey, final ExpectedActionKey nextKey,
+ final ExpectedActionKey doneKey, final ExpectedActionKey previousKey) {
+ doTestActionKey(
+ tag + " unspecified", subtype, EditorInfo.IME_ACTION_UNSPECIFIED, unspecifiedKey);
+ doTestActionKey(tag + " none", subtype, EditorInfo.IME_ACTION_NONE, noneKey);
+ doTestActionKey(tag + " go", subtype, EditorInfo.IME_ACTION_GO, goKey);
+ doTestActionKey(tag + " search", subtype, EditorInfo.IME_ACTION_SEARCH, searchKey);
+ doTestActionKey(tag + " send", subtype, EditorInfo.IME_ACTION_SEND, sendKey);
+ doTestActionKey(tag + " next", subtype, EditorInfo.IME_ACTION_NEXT, nextKey);
+ doTestActionKey(tag + " done", subtype, EditorInfo.IME_ACTION_DONE, doneKey);
+ doTestActionKey(tag + " previous", subtype, EditorInfo.IME_ACTION_PREVIOUS, previousKey);
+ }
+
// Working variable to simulate system locale changing.
private Locale mSystemLocale = Locale.getDefault();
- private void doTestActionLabelInLocale(final InputMethodSubtype subtype,
+ private void doTestActionKeysInLocale(final InputMethodSubtype subtype,
final Locale labelLocale, final Locale systemLocale) {
// Simulate system locale changing, see {@link SystemBroadcastReceiver}.
if (!systemLocale.equals(mSystemLocale)) {
KeyboardLayoutSet.onSystemLocaleChanged();
mSystemLocale = systemLocale;
}
+ final ExpectedActionKey enterKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_ENTER_KEY);
+ final ExpectedActionKey goKey = ExpectedActionKey.newLabelKey(
+ R.string.label_go_key, labelLocale, getContext());
+ final ExpectedActionKey searchKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_SEARCH_KEY);
+ final ExpectedActionKey sendKey = ExpectedActionKey.newLabelKey(
+ R.string.label_send_key, labelLocale, getContext());
+ final ExpectedActionKey nextKey = ExpectedActionKey.newLabelKey(
+ R.string.label_next_key, labelLocale, getContext());
+ final ExpectedActionKey doneKey = ExpectedActionKey.newLabelKey(
+ R.string.label_done_key, labelLocale, getContext());
+ final ExpectedActionKey previousKey = ExpectedActionKey.newLabelKey(
+ R.string.label_previous_key, labelLocale, getContext());
final String tag = "label=" + labelLocale + " system=" + systemLocale
+ " " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
final RunInLocale<Void> job = new RunInLocale<Void>() {
@Override
public Void job(final Resources res) {
- doTestActionKeyIcon(tag + " unspecified", subtype,
- EditorInfo.IME_ACTION_UNSPECIFIED, KeyboardIconsSet.NAME_ENTER_KEY);
- doTestActionKeyIcon(tag + " none", subtype,
- EditorInfo.IME_ACTION_NONE, KeyboardIconsSet.NAME_ENTER_KEY);
- doTestActionKeyLabelResIdInLocale(tag + " go", subtype,
- EditorInfo.IME_ACTION_GO, labelLocale, R.string.label_go_key);
- doTestActionKeyIcon(tag + " search", subtype,
- EditorInfo.IME_ACTION_SEARCH, KeyboardIconsSet.NAME_SEARCH_KEY);
- doTestActionKeyLabelResIdInLocale(tag + " send", subtype,
- EditorInfo.IME_ACTION_SEND, labelLocale, R.string.label_send_key);
- doTestActionKeyLabelResIdInLocale(tag + " next", subtype,
- EditorInfo.IME_ACTION_NEXT, labelLocale, R.string.label_next_key);
- doTestActionKeyLabelResIdInLocale(tag + " done", subtype,
- EditorInfo.IME_ACTION_DONE, labelLocale, R.string.label_done_key);
- doTestActionKeyLabelResIdInLocale(tag + " previous", subtype,
- EditorInfo.IME_ACTION_PREVIOUS, labelLocale, R.string.label_previous_key);
+ doTestActionKeys(subtype, tag, enterKey, enterKey, goKey, searchKey, sendKey,
+ nextKey, doneKey, previousKey);
return null;
}
};
@@ -123,10 +144,10 @@ public class KeyboardLayoutSetActionLabelKlpTests extends KeyboardLayoutSetActio
final InputMethodSubtype italian = richImm.findSubtypeByLocaleAndKeyboardLayoutSet(
Locale.ITALIAN.toString(), SubtypeLocaleUtils.QWERTY);
// An action label should be displayed in subtype's locale regardless of the system locale.
- doTestActionLabelInLocale(italian, Locale.ITALIAN, Locale.US);
- doTestActionLabelInLocale(italian, Locale.ITALIAN, Locale.FRENCH);
- doTestActionLabelInLocale(italian, Locale.ITALIAN, Locale.ITALIAN);
- doTestActionLabelInLocale(italian, Locale.ITALIAN, Locale.JAPANESE);
+ doTestActionKeysInLocale(italian, Locale.ITALIAN, Locale.US);
+ doTestActionKeysInLocale(italian, Locale.ITALIAN, Locale.FRENCH);
+ doTestActionKeysInLocale(italian, Locale.ITALIAN, Locale.ITALIAN);
+ doTestActionKeysInLocale(italian, Locale.ITALIAN, Locale.JAPANESE);
}
public void testNoLanguageSubtypeActionLabel() {
@@ -134,9 +155,9 @@ public class KeyboardLayoutSetActionLabelKlpTests extends KeyboardLayoutSetActio
final InputMethodSubtype noLanguage = richImm.findSubtypeByLocaleAndKeyboardLayoutSet(
SubtypeLocaleUtils.NO_LANGUAGE, SubtypeLocaleUtils.QWERTY);
// An action label of no language keyboard should be displayed in the system locale.
- doTestActionLabelInLocale(noLanguage, Locale.US, Locale.US);
- doTestActionLabelInLocale(noLanguage, Locale.FRENCH, Locale.FRENCH);
- doTestActionLabelInLocale(noLanguage, Locale.ITALIAN, Locale.ITALIAN);
- doTestActionLabelInLocale(noLanguage, Locale.JAPANESE, Locale.JAPANESE);
+ doTestActionKeysInLocale(noLanguage, Locale.US, Locale.US);
+ doTestActionKeysInLocale(noLanguage, Locale.FRENCH, Locale.FRENCH);
+ doTestActionKeysInLocale(noLanguage, Locale.ITALIAN, Locale.ITALIAN);
+ doTestActionKeysInLocale(noLanguage, Locale.JAPANESE, Locale.JAPANESE);
}
}
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java
index 028b3e400..fec501db1 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java
@@ -32,46 +32,51 @@ public class KeyboardLayoutSetActionLabelLxxTests extends KeyboardLayoutSetActio
@Override
public void testActionGo() {
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_GO_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "go " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyIcon(tag, subtype, EditorInfo.IME_ACTION_GO,
- KeyboardIconsSet.NAME_GO_KEY);
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_GO, expectedKey);
}
}
@Override
public void testActionSend() {
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_SEND_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "send " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyIcon(tag, subtype, EditorInfo.IME_ACTION_SEND,
- KeyboardIconsSet.NAME_SEND_KEY);
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEND, expectedKey);
}
}
@Override
public void testActionNext() {
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_NEXT_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "next " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyIcon(tag, subtype, EditorInfo.IME_ACTION_NEXT,
- KeyboardIconsSet.NAME_NEXT_KEY);
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NEXT, expectedKey);
}
}
@Override
public void testActionDone() {
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_DONE_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "done " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyIcon(tag, subtype, EditorInfo.IME_ACTION_DONE,
- KeyboardIconsSet.NAME_DONE_KEY);
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_DONE, expectedKey);
}
}
@Override
public void testActionPrevious() {
+ final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+ KeyboardIconsSet.NAME_PREVIOUS_KEY);
for (final InputMethodSubtype subtype : getAllSubtypesList()) {
final String tag = "previous " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
- doTestActionKeyIcon(tag, subtype, EditorInfo.IME_ACTION_PREVIOUS,
- KeyboardIconsSet.NAME_PREVIOUS_KEY);
+ doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_PREVIOUS, expectedKey);
}
}
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKey.java b/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKey.java
index 2674a6a69..5c147a3b6 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKey.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKey.java
@@ -105,11 +105,11 @@ public class ExpectedKey {
// The expected output of this key.
private final ExpectedKeyOutput mOutput;
- public final ExpectedKeyVisual getVisual() {
+ protected final ExpectedKeyVisual getVisual() {
return mVisual;
}
- public final ExpectedKeyOutput getOutput() {
+ protected final ExpectedKeyOutput getOutput() {
return mOutput;
}
@@ -162,18 +162,19 @@ public class ExpectedKey {
public boolean equalsTo(final Key key) {
// This key has no "more keys".
- return mVisual.equalsTo(key) && mOutput.equalsTo(key) && key.getMoreKeys() == null;
+ return mVisual.hasSameKeyVisual(key) && mOutput.hasSameKeyOutput(key)
+ && key.getMoreKeys() == null;
}
public boolean equalsTo(final MoreKeySpec moreKeySpec) {
- return mVisual.equalsTo(moreKeySpec) && mOutput.equalsTo(moreKeySpec);
+ return mVisual.hasSameKeyVisual(moreKeySpec) && mOutput.hasSameKeyOutput(moreKeySpec);
}
@Override
public boolean equals(final Object object) {
if (object instanceof ExpectedKey) {
final ExpectedKey key = (ExpectedKey) object;
- return mVisual.equalsTo(key.mVisual) && mOutput.equalsTo(key.mOutput)
+ return mVisual.hasSameKeyVisual(key.mVisual) && mOutput.hasSameKeyOutput(key.mOutput)
&& Arrays.equals(getMoreKeys(), key.getMoreKeys());
}
return false;
@@ -190,7 +191,7 @@ public class ExpectedKey {
@Override
public String toString() {
- if (mVisual.equalsTo(mOutput)) {
+ if (mVisual.hasSameKeyVisual(mOutput)) {
return mVisual.toString();
}
return mVisual + "|" + mOutput;
@@ -274,7 +275,7 @@ public class ExpectedKey {
@Override
public boolean equalsTo(final Key key) {
- if (getVisual().equalsTo(key) && getOutput().equalsTo(key)) {
+ if (getVisual().hasSameKeyVisual(key) && getOutput().hasSameKeyOutput(key)) {
final MoreKeySpec[] moreKeySpecs = key.getMoreKeys();
final ExpectedKey[] moreKeys = getMoreKeys();
// This key should have at least one "more key".
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyOutput.java b/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyOutput.java
index 737d1695b..5c1a70fa3 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyOutput.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyOutput.java
@@ -43,10 +43,10 @@ abstract class ExpectedKeyOutput {
abstract ExpectedKeyOutput toUpperCase(final Locale locale);
abstract ExpectedKeyOutput preserveCase();
- abstract boolean equalsTo(final String text);
- abstract boolean equalsTo(final Key key);
- abstract boolean equalsTo(final MoreKeySpec moreKeySpec);
- abstract boolean equalsTo(final ExpectedKeyOutput output);
+ abstract boolean hasSameKeyOutput(final String text);
+ abstract boolean hasSameKeyOutput(final Key key);
+ abstract boolean hasSameKeyOutput(final MoreKeySpec moreKeySpec);
+ abstract boolean hasSameKeyOutput(final ExpectedKeyOutput output);
/**
* This class represents an integer code point.
@@ -75,22 +75,22 @@ abstract class ExpectedKeyOutput {
}
@Override
- boolean equalsTo(final String text) {
+ boolean hasSameKeyOutput(final String text) {
return StringUtils.codePointCount(text) == 1 && text.codePointAt(0) == mCode;
}
@Override
- boolean equalsTo(final Key key) {
+ boolean hasSameKeyOutput(final Key key) {
return mCode == key.getCode();
}
@Override
- boolean equalsTo(final MoreKeySpec moreKeySpec) {
+ boolean hasSameKeyOutput(final MoreKeySpec moreKeySpec) {
return mCode == moreKeySpec.mCode;
}
@Override
- boolean equalsTo(final ExpectedKeyOutput output) {
+ boolean hasSameKeyOutput(final ExpectedKeyOutput output) {
return (output instanceof Code) && mCode == ((Code)output).mCode;
}
@@ -130,24 +130,24 @@ abstract class ExpectedKeyOutput {
}
@Override
- boolean equalsTo(final String text) {
+ boolean hasSameKeyOutput(final String text) {
return text.equals(text);
}
@Override
- boolean equalsTo(final Key key) {
+ boolean hasSameKeyOutput(final Key key) {
return key.getCode() == Constants.CODE_OUTPUT_TEXT
&& mText.equals(key.getOutputText());
}
@Override
- boolean equalsTo(final MoreKeySpec moreKeySpec) {
+ boolean hasSameKeyOutput(final MoreKeySpec moreKeySpec) {
return moreKeySpec.mCode == Constants.CODE_OUTPUT_TEXT
&& mText.equals(moreKeySpec.mOutputText);
}
@Override
- boolean equalsTo(final ExpectedKeyOutput output) {
+ boolean hasSameKeyOutput(final ExpectedKeyOutput output) {
return (output instanceof Text) && mText == ((Text)output).mText;
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyVisual.java b/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyVisual.java
index facdf7043..2f3a0c15f 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyVisual.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyVisual.java
@@ -27,22 +27,24 @@ import java.util.Locale;
*
* There are two types of expected visual, an integer icon id and a string label.
*/
-abstract class ExpectedKeyVisual {
- static ExpectedKeyVisual newInstance(final String label) {
+public abstract class ExpectedKeyVisual {
+ public static ExpectedKeyVisual newInstance(final String label) {
return new Label(label);
}
- static ExpectedKeyVisual newInstance(final int iconId) {
+ public static ExpectedKeyVisual newInstance(final int iconId) {
return new Icon(iconId);
}
+ public abstract int getIconId();
+ public abstract String getLabel();
abstract ExpectedKeyVisual toUpperCase(final Locale locale);
abstract ExpectedKeyVisual preserveCase();
- abstract boolean equalsTo(final String text);
- abstract boolean equalsTo(final Key key);
- abstract boolean equalsTo(final MoreKeySpec moreKeySpec);
- abstract boolean equalsTo(final ExpectedKeyOutput output);
- abstract boolean equalsTo(final ExpectedKeyVisual visual);
+ abstract boolean hasSameKeyVisual(final String text);
+ abstract boolean hasSameKeyVisual(final Key key);
+ abstract boolean hasSameKeyVisual(final MoreKeySpec moreKeySpec);
+ abstract boolean hasSameKeyVisual(final ExpectedKeyOutput output);
+ abstract boolean hasSameKeyVisual(final ExpectedKeyVisual visual);
/**
* This class represents an integer icon id.
@@ -55,6 +57,16 @@ abstract class ExpectedKeyVisual {
}
@Override
+ public int getIconId() {
+ return mIconId;
+ }
+
+ @Override
+ public String getLabel() {
+ return null;
+ }
+
+ @Override
ExpectedKeyVisual toUpperCase(final Locale locale) {
return this;
}
@@ -65,27 +77,32 @@ abstract class ExpectedKeyVisual {
}
@Override
- boolean equalsTo(final String text) {
+ boolean hasSameKeyVisual(final String text) {
return false;
}
@Override
- boolean equalsTo(final Key key) {
- return mIconId == key.getIconId();
+ boolean hasSameKeyVisual(final Key key) {
+ // If the actual key has an icon as its visual, a label has to be null.
+ // See {@link KeyboardView#onDrawKeyTopVisuals(Key,Canvas,Paint,KeyDrawParams).
+ return mIconId == key.getIconId() && key.getLabel() == null;
}
@Override
- boolean equalsTo(final MoreKeySpec moreKeySpec) {
- return mIconId == moreKeySpec.mIconId;
+ boolean hasSameKeyVisual(final MoreKeySpec moreKeySpec) {
+ // If the actual more key has an icon as its visual, a label has to be null.
+ // See {@link KeySpecParser#getIconId(String)} and
+ // {@link KeySpecParser#getLabel(String)}.
+ return mIconId == moreKeySpec.mIconId && moreKeySpec.mLabel == null;
}
@Override
- boolean equalsTo(final ExpectedKeyOutput output) {
+ boolean hasSameKeyVisual(final ExpectedKeyOutput output) {
return false;
}
@Override
- boolean equalsTo(final ExpectedKeyVisual visual) {
+ boolean hasSameKeyVisual(final ExpectedKeyVisual visual) {
return (visual instanceof Icon) && mIconId == ((Icon)visual).mIconId;
}
@@ -101,7 +118,19 @@ abstract class ExpectedKeyVisual {
private static class Label extends ExpectedKeyVisual {
private final String mLabel;
- Label(final String label) { mLabel = label; }
+ Label(final String label) {
+ mLabel = label;
+ }
+
+ @Override
+ public int getIconId() {
+ return KeyboardIconsSet.ICON_UNDEFINED;
+ }
+
+ @Override
+ public String getLabel() {
+ return mLabel;
+ }
@Override
ExpectedKeyVisual toUpperCase(final Locale locale) {
@@ -114,27 +143,34 @@ abstract class ExpectedKeyVisual {
}
@Override
- boolean equalsTo(final String text) {
+ boolean hasSameKeyVisual(final String text) {
return mLabel.equals(text);
}
@Override
- boolean equalsTo(final Key key) {
- return mLabel.equals(key.getLabel());
+ boolean hasSameKeyVisual(final Key key) {
+ // If the actual key has a label as its visual, an icon has to be undefined.
+ // See {@link KeyboardView#onDrawKeyTopVisuals(Key,Canvas,Paint,KeyDrawParams).
+ return mLabel.equals(key.getLabel())
+ && key.getIconId() == KeyboardIconsSet.ICON_UNDEFINED;
}
@Override
- boolean equalsTo(final MoreKeySpec moreKeySpec) {
- return mLabel.equals(moreKeySpec.mLabel);
+ boolean hasSameKeyVisual(final MoreKeySpec moreKeySpec) {
+ // If the actual more key has a label as its visual, an icon has to be undefined.
+ // See {@link KeySpecParser#getIconId(String)} and
+ // {@link KeySpecParser#getLabel(String)}.
+ return mLabel.equals(moreKeySpec.mLabel)
+ && moreKeySpec.mIconId == KeyboardIconsSet.ICON_UNDEFINED;
}
@Override
- boolean equalsTo(final ExpectedKeyOutput output) {
- return output.equalsTo(mLabel);
+ boolean hasSameKeyVisual(final ExpectedKeyOutput output) {
+ return output.hasSameKeyOutput(mLabel);
}
@Override
- boolean equalsTo(final ExpectedKeyVisual visual) {
+ boolean hasSameKeyVisual(final ExpectedKeyVisual visual) {
return (visual instanceof Label) && mLabel.equals(((Label)visual).mLabel);
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyboardBuilder.java b/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyboardBuilder.java
index 9b7de88ea..f5531c9e3 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyboardBuilder.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/expected/ExpectedKeyboardBuilder.java
@@ -91,7 +91,7 @@ public final class ExpectedKeyboardBuilder extends AbstractKeyboardBuilder<Expec
ExpectedKey[] keys = getRowAt(row);
for (int columnIndex = 0; columnIndex < keys.length; /* nothing */) {
final ExpectedKey currentKey = keys[columnIndex];
- if (!currentKey.getVisual().equalsTo(visual)) {
+ if (!currentKey.getVisual().hasSameKeyVisual(visual)) {
columnIndex++;
continue;
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/EnglishSplitCustomizer.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/EnglishSplitCustomizer.java
deleted file mode 100644
index b6d57d33a..000000000
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/EnglishSplitCustomizer.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.inputmethod.keyboard.layout.tests;
-
-import com.android.inputmethod.keyboard.layout.LayoutBase;
-import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
-
-import java.util.Locale;
-
-public class EnglishSplitCustomizer extends EnglishCustomizer {
-
- EnglishSplitCustomizer(Locale locale) {
- super(locale);
- }
-
- @Override
- public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
- return LayoutBase.joinKeys(
- LayoutBase.LANGUAGE_SWITCH_KEY, LayoutBase.SPACE_KEY, LayoutBase.SPACE_KEY);
- }
-}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsAzerbaijaniAZ.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsAzerbaijaniAZ.java
index f5317e269..8e0e2bbbd 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsAzerbaijaniAZ.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsAzerbaijaniAZ.java
@@ -19,9 +19,7 @@ package com.android.inputmethod.keyboard.layout.tests;
import android.test.suitebuilder.annotation.SmallTest;
import com.android.inputmethod.keyboard.layout.LayoutBase;
-import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
import com.android.inputmethod.keyboard.layout.Qwerty;
-import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
import java.util.Locale;
@@ -31,58 +29,8 @@ import java.util.Locale;
@SmallTest
public final class TestsAzerbaijaniAZ extends LayoutTestsBase {
private static final Locale LOCALE = new Locale("az", "AZ");
- private static final LayoutBase LAYOUT = new Qwerty(new AzerbaijaniAZCustomizer(LOCALE));
+ private static final LayoutBase LAYOUT = new Qwerty(new TurkicCustomizer(LOCALE));
@Override
LayoutBase getLayout() { return LAYOUT; }
-
- private static final class AzerbaijaniAZCustomizer extends LayoutCustomizer {
- public AzerbaijaniAZCustomizer(final Locale locale) { super(locale); }
-
- @Override
- public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
- return builder
- // U+0259: "ə" LATIN SMALL LETTER SCHWA
- .setMoreKeysOf("e", "\u0259")
- // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
- // U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
- // U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
- // U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
- // U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
- .setMoreKeysOf("u", "\u00FC", "\u00FB", "\u00F9", "\u00FA", "\u016B")
- // U+0131: "ı" LATIN SMALL LETTER DOTLESS I
- // U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
- // U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
- // U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
- // U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
- // U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
- // U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
- .setMoreKeysOf("i",
- "\u0131", "\u00EE", "\u00EF", "\u00EC", "\u00ED", "\u012F", "\u012B")
- // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
- // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
- // U+0153: "œ" LATIN SMALL LIGATURE OE
- // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
- // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
- // U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
- // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
- // U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
- .setMoreKeysOf("o",
- "\u00F6", "\u00F4", "\u0153", "\u00F2", "\u00F3", "\u00F5", "\u00F8",
- "\u014D")
- // U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
- .setMoreKeysOf("a", "\u00E2")
- // U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA
- // U+00DF: "ß" LATIN SMALL LETTER SHARP S
- // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE
- // U+0161: "š" LATIN SMALL LETTER S WITH CARON
- .setMoreKeysOf("s", "\u015F", "\u00DF", "\u015B", "\u0161")
- // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
- // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
- // U+010D: "č" LATIN SMALL LETTER C WITH CARON
- .setMoreKeysOf("c", "\u00E7", "\u0107", "\u010D")
- // U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE
- .setMoreKeysOf("g", "\u011F");
- }
- }
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java
index b9e40e0e7..b3340aace 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsSplitLayoutQwertyEnglishUS.java
@@ -23,6 +23,7 @@ import android.view.inputmethod.InputMethodSubtype;
import com.android.inputmethod.keyboard.KeyboardLayoutSet;
import com.android.inputmethod.keyboard.layout.LayoutBase;
import com.android.inputmethod.keyboard.layout.Qwerty;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
import java.util.Locale;
@@ -44,4 +45,20 @@ public class TestsSplitLayoutQwertyEnglishUS extends LayoutTestsBase {
@Override
LayoutBase getLayout() { return LAYOUT; }
+
+ private static class EnglishSplitCustomizer extends EnglishCustomizer {
+ EnglishSplitCustomizer(Locale locale) {
+ super(locale);
+ }
+
+ @Override
+ public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
+ if (isPhone) {
+ return super.getSpaceKeys(isPhone);
+ } else {
+ return LayoutBase.joinKeys(
+ LayoutBase.LANGUAGE_SWITCH_KEY, LayoutBase.SPACE_KEY, LayoutBase.SPACE_KEY);
+ }
+ }
+ }
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsTurkish.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsTurkish.java
index b35f8850a..bf427cdb0 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsTurkish.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsTurkish.java
@@ -37,50 +37,16 @@ public final class TestsTurkish extends LayoutTestsBase {
LayoutBase getLayout() { return LAYOUT; }
private static class TurkishCustomizer extends EuroCustomizer {
- public TurkishCustomizer(final Locale locale) { super(locale); }
+ private final TurkicCustomizer mTurkicCustomizer;
+
+ public TurkishCustomizer(final Locale locale) {
+ super(locale);
+ mTurkicCustomizer = new TurkicCustomizer(locale);
+ }
@Override
public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
- return builder
- // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
- // U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
- // U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
- // U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
- // U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
- .setMoreKeysOf("u", "\u00FC", "\u00FB", "\u00F9", "\u00FA", "\u016B")
- // U+0131: "ı" LATIN SMALL LETTER DOTLESS I
- // U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
- // U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
- // U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
- // U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
- // U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
- // U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
- .setMoreKeysOf("i",
- "\u0131", "\u00EE", "\u00EF", "\u00EC", "\u00ED", "\u012F", "\u012B")
- // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
- // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
- // U+0153: "œ" LATIN SMALL LIGATURE OE
- // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
- // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
- // U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
- // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
- // U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
- .setMoreKeysOf("o",
- "\u00F6", "\u00F4", "\u0153", "\u00F2", "\u00F3", "\u00F5", "\u00F8",
- "\u014D")
- // U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
- .setMoreKeysOf("a", "\u00E2")
- // U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA
- // U+00DF: "ß" LATIN SMALL LETTER SHARP S
- // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE
- // U+0161: "š" LATIN SMALL LETTER S WITH CARON
- .setMoreKeysOf("s", "\u015F", "\u00DF", "\u015B", "\u0161")
- // U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE
- .setMoreKeysOf("g", "\u011F")
- // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
- // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
- // U+010D: "č" LATIN SMALL LETTER C WITH CARON
- .setMoreKeysOf("c", "\u00E7", "\u0107", "\u010D");
+ return mTurkicCustomizer.setAccentedLetters(builder);
}
}
}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TurkicCustomizer.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TurkicCustomizer.java
new file mode 100644
index 000000000..1a98f6ccf
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TurkicCustomizer.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.keyboard.layout.tests;
+
+import com.android.inputmethod.keyboard.layout.LayoutBase.LayoutCustomizer;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+
+import java.util.Locale;
+
+/**
+ * Turkic languages layout customizer.
+ */
+class TurkicCustomizer extends LayoutCustomizer {
+ public TurkicCustomizer(final Locale locale) { super(locale); }
+
+ @Override
+ public ExpectedKeyboardBuilder setAccentedLetters(final ExpectedKeyboardBuilder builder) {
+ return builder
+ // U+0259: "ə" LATIN SMALL LETTER SCHWA
+ // U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ .setMoreKeysOf("e", "\u0259", "\u00E9")
+ // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE
+ .setMoreKeysOf("y", "\u00FD")
+ // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ // U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ // U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ // U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ // U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
+ .setMoreKeysOf("u", "\u00FC", "\u00FB", "\u00F9", "\u00FA", "\u016B")
+ // U+0131: "ı" LATIN SMALL LETTER DOTLESS I
+ // U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ // U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ // U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
+ // U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ // U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
+ // U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ .setMoreKeysOf("i",
+ "\u0131", "\u00EE", "\u00EF", "\u00EC", "\u00ED", "\u012F", "\u012B")
+ // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ // U+0153: "œ" LATIN SMALL LIGATURE OE
+ // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ // U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
+ // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ // U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+ .setMoreKeysOf("o",
+ "\u00F6", "\u00F4", "\u0153", "\u00F2", "\u00F3", "\u00F5", "\u00F8",
+ "\u014D")
+ // U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ // U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ .setMoreKeysOf("a", "\u00E2", "\u00E4", "\u00E1")
+ // U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA
+ // U+00DF: "ß" LATIN SMALL LETTER SHARP S
+ // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE
+ // U+0161: "š" LATIN SMALL LETTER S WITH CARON
+ .setMoreKeysOf("s", "\u015F", "\u00DF", "\u015B", "\u0161")
+ // U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE
+ .setMoreKeysOf("g", "\u011F")
+ // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON
+ .setMoreKeysOf("z", "\u017E")
+ // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
+ // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
+ // U+010D: "č" LATIN SMALL LETTER C WITH CARON
+ .setMoreKeysOf("c", "\u00E7", "\u0107", "\u010D")
+ // U+0148: "ň" LATIN SMALL LETTER N WITH CARON
+ // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
+ .setMoreKeysOf("n", "\u0148", "\u00F1");
+ }
+} \ No newline at end of file
diff --git a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java
index 869c550e0..563261f8f 100644
--- a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java
+++ b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java
@@ -147,7 +147,7 @@ public class SuggestedWordsTests extends AndroidTestCase {
assertNull(wordsWithoutTypedWord.getTypedWordInfoOrNull());
// Make sure getTypedWordInfoOrNull() returns null.
- assertNull(SuggestedWords.EMPTY.getTypedWordInfoOrNull());
+ assertNull(SuggestedWords.getEmptyInstance().getTypedWordInfoOrNull());
final SuggestedWords emptySuggestedWords = new SuggestedWords(
new ArrayList<SuggestedWordInfo>(), null /* rawSuggestions */,
@@ -157,6 +157,6 @@ public class SuggestedWordsTests extends AndroidTestCase {
SuggestedWords.INPUT_STYLE_NONE);
assertNull(emptySuggestedWords.getTypedWordInfoOrNull());
- assertNull(SuggestedWords.EMPTY.getTypedWordInfoOrNull());
+ assertNull(SuggestedWords.getEmptyInstance().getTypedWordInfoOrNull());
}
}
diff --git a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
index 62f106110..616209682 100644
--- a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
+++ b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
@@ -213,13 +213,9 @@ public class UserHistoryDictionaryTests extends AndroidTestCase {
final int numberOfWords = 1000;
final Random random = new Random(123456);
-
- try {
- clearHistory(dict);
- addAndWriteRandomWords(dict, numberOfWords, random, true /* checksContents */);
- } finally {
- checkExistenceAndRemoveDictFile(dict, dictFile);
- }
+ clearHistory(dict);
+ addAndWriteRandomWords(dict, numberOfWords, random, true /* checksContents */);
+ checkExistenceAndRemoveDictFile(dict, dictFile);
}
public void testStressTestForSwitchingLanguagesAndAddingWords() {
@@ -312,5 +308,6 @@ public class UserHistoryDictionaryTests extends AndroidTestCase {
for (final String word : words) {
assertFalse(dict.isInDictionary(word));
}
+ stopTestModeInNativeCode();
}
}
diff --git a/tests/src/com/android/inputmethod/latin/utils/ImportantNoticeUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/ImportantNoticeUtilsTests.java
new file mode 100644
index 000000000..819d76328
--- /dev/null
+++ b/tests/src/com/android/inputmethod/latin/utils/ImportantNoticeUtilsTests.java
@@ -0,0 +1,222 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.latin.utils;
+
+import static com.android.inputmethod.latin.utils.ImportantNoticeUtils.KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE;
+import static com.android.inputmethod.latin.utils.ImportantNoticeUtils.KEY_IMPORTANT_NOTICE_VERSION;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.test.AndroidTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+import android.text.TextUtils;
+
+import java.util.concurrent.TimeUnit;
+
+@SmallTest
+public class ImportantNoticeUtilsTests extends AndroidTestCase {
+ // This should be aligned with R.integer.config_important_notice_version.
+ private static final int CURRENT_IMPORTANT_NOTICE_VERSION = 1;
+
+ private ImportantNoticePreferences mImportantNoticePreferences;
+
+ private static class ImportantNoticePreferences {
+ private final SharedPreferences mPref;
+
+ private Integer mVersion;
+ private Long mLastTime;
+
+ public ImportantNoticePreferences(final Context context) {
+ mPref = ImportantNoticeUtils.getImportantNoticePreferences(context);
+ }
+
+ private Integer getInt(final String key) {
+ if (mPref.contains(key)) {
+ return mPref.getInt(key, 0);
+ }
+ return null;
+ }
+
+ public Long getLong(final String key) {
+ if (mPref.contains(key)) {
+ return mPref.getLong(key, 0);
+ }
+ return null;
+ }
+
+ private void putInt(final String key, final Integer value) {
+ if (value == null) {
+ removePreference(key);
+ } else {
+ mPref.edit().putInt(key, value).apply();
+ }
+ }
+
+ private void putLong(final String key, final Long value) {
+ if (value == null) {
+ removePreference(key);
+ } else {
+ mPref.edit().putLong(key, value).apply();
+ }
+ }
+
+ private void removePreference(final String key) {
+ mPref.edit().remove(key).apply();
+ }
+
+ public void save() {
+ mVersion = getInt(KEY_IMPORTANT_NOTICE_VERSION);
+ mLastTime = getLong(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE);
+ }
+
+ public void restore() {
+ putInt(KEY_IMPORTANT_NOTICE_VERSION, mVersion);
+ putLong(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE, mLastTime);
+ }
+
+ public void clear() {
+ removePreference(KEY_IMPORTANT_NOTICE_VERSION);
+ removePreference(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE);
+ }
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ mImportantNoticePreferences = new ImportantNoticePreferences(getContext());
+ mImportantNoticePreferences.save();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ mImportantNoticePreferences.restore();
+ }
+
+ public void testCurrentVersion() {
+ assertEquals("Current version", CURRENT_IMPORTANT_NOTICE_VERSION,
+ ImportantNoticeUtils.getCurrentImportantNoticeVersion(getContext()));
+ }
+
+ public void testUpdateVersion() {
+ mImportantNoticePreferences.clear();
+
+ assertEquals("Current boolean before update", true,
+ ImportantNoticeUtils.shouldShowImportantNotice(getContext()));
+ assertEquals("Last version before update", 0,
+ ImportantNoticeUtils.getLastImportantNoticeVersion(getContext()));
+ assertEquals("Next version before update ", 1,
+ ImportantNoticeUtils.getNextImportantNoticeVersion(getContext()));
+ assertEquals("Current title before update", false, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeTitle(getContext())));
+ assertEquals("Current contents before update", false, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeContents(getContext())));
+
+ ImportantNoticeUtils.updateLastImportantNoticeVersion(getContext());
+
+ assertEquals("Current boolean after update", false,
+ ImportantNoticeUtils.shouldShowImportantNotice(getContext()));
+ assertEquals("Last version after update", 1,
+ ImportantNoticeUtils.getLastImportantNoticeVersion(getContext()));
+ assertEquals("Next version after update", 2,
+ ImportantNoticeUtils.getNextImportantNoticeVersion(getContext()));
+ assertEquals("Current title after update", true, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeTitle(getContext())));
+ assertEquals("Current contents after update", true, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeContents(getContext())));
+ }
+
+ private static void sleep(final long millseconds) {
+ try { Thread.sleep(millseconds); } catch (final Exception e) { /* ignore */ }
+ }
+
+ public void testTimeout() {
+ final long lastTime = System.currentTimeMillis()
+ - ImportantNoticeUtils.TIMEOUT_OF_IMPORTANT_NOTICE
+ + TimeUnit.MILLISECONDS.toMillis(1000);
+ mImportantNoticePreferences.clear();
+ assertEquals("Before set last time", null,
+ mImportantNoticePreferences.getLong(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE));
+ assertEquals("Set last time", false,
+ ImportantNoticeUtils.hasTimeoutPassed(getContext(), lastTime));
+ assertEquals("After set last time", (Long)lastTime,
+ mImportantNoticePreferences.getLong(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE));
+
+ // Call {@link ImportantNoticeUtils#shouldShowImportantNotice(Context)} before timeout.
+ assertEquals("Current boolean before timeout 1", true,
+ ImportantNoticeUtils.shouldShowImportantNotice(getContext()));
+ assertEquals("Last version before timeout 1", 0,
+ ImportantNoticeUtils.getLastImportantNoticeVersion(getContext()));
+ assertEquals("Next version before timeout 1", 1,
+ ImportantNoticeUtils.getNextImportantNoticeVersion(getContext()));
+ assertEquals("Last time before timeout 1", (Long)lastTime,
+ mImportantNoticePreferences.getLong(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE));
+ assertEquals("Current title before timeout 1", false, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeTitle(getContext())));
+ assertEquals("Current contents before timeout 1", false, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeContents(getContext())));
+
+ sleep(TimeUnit.MILLISECONDS.toMillis(600));
+
+ // Call {@link ImportantNoticeUtils#shouldShowImportantNotice(Context)} before timeout
+ // again.
+ assertEquals("Current boolean before timeout 2", true,
+ ImportantNoticeUtils.shouldShowImportantNotice(getContext()));
+ assertEquals("Last version before timeout 2", 0,
+ ImportantNoticeUtils.getLastImportantNoticeVersion(getContext()));
+ assertEquals("Next version before timeout 2", 1,
+ ImportantNoticeUtils.getNextImportantNoticeVersion(getContext()));
+ assertEquals("Last time before timeout 2", (Long)lastTime,
+ mImportantNoticePreferences.getLong(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE));
+ assertEquals("Current title before timeout 2", false, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeTitle(getContext())));
+ assertEquals("Current contents before timeout 2", false, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeContents(getContext())));
+
+ sleep(TimeUnit.MILLISECONDS.toMillis(600));
+
+ // Call {@link ImportantNoticeUtils#shouldShowImportantNotice(Context)} after timeout.
+ assertEquals("Current boolean after timeout 1", false,
+ ImportantNoticeUtils.shouldShowImportantNotice(getContext()));
+ assertEquals("Last version after timeout 1", 1,
+ ImportantNoticeUtils.getLastImportantNoticeVersion(getContext()));
+ assertEquals("Next version after timeout 1", 2,
+ ImportantNoticeUtils.getNextImportantNoticeVersion(getContext()));
+ assertEquals("Last time aflter timeout 1", null,
+ mImportantNoticePreferences.getLong(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE));
+ assertEquals("Current title after timeout 1", true, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeTitle(getContext())));
+ assertEquals("Current contents after timeout 1", true, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeContents(getContext())));
+
+ sleep(TimeUnit.MILLISECONDS.toMillis(600));
+
+ // Call {@link ImportantNoticeUtils#shouldShowImportantNotice(Context)} after timeout again.
+ assertEquals("Current boolean after timeout 2", false,
+ ImportantNoticeUtils.shouldShowImportantNotice(getContext()));
+ assertEquals("Last version after timeout 2", 1,
+ ImportantNoticeUtils.getLastImportantNoticeVersion(getContext()));
+ assertEquals("Next version after timeout 2", 2,
+ ImportantNoticeUtils.getNextImportantNoticeVersion(getContext()));
+ assertEquals("Last time aflter timeout 2", null,
+ mImportantNoticePreferences.getLong(KEY_TIMESTAMP_OF_FIRST_IMPORTANT_NOTICE));
+ assertEquals("Current title after timeout 2", true, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeTitle(getContext())));
+ assertEquals("Current contents after timeout 2", true, TextUtils.isEmpty(
+ ImportantNoticeUtils.getNextImportantNoticeContents(getContext())));
+ }
+}