From 88984aedae83d15b47a22f2716c8d01b1fa7f4d8 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Thu, 25 Sep 2014 23:48:23 +0900
Subject: [PATCH] Split up long unit tests into smaller ones

Bug: 17654015
Change-Id: Ia2fe61554c1c5752fe38928ae6433ebaedcfdda7
---
 .../KeyboardLayoutSetActionLabelLxxTests.java | 82 ------------------
 .../ActionTestsBase.java}                     | 54 ++----------
 .../keyboard/action/KlpActionCustomTests.java | 37 ++++++++
 .../keyboard/action/KlpActionDoneTests.java   | 36 ++++++++
 .../keyboard/action/KlpActionGoTests.java     | 36 ++++++++
 .../KlpActionLabelTests.java}                 | 86 +------------------
 .../keyboard/action/KlpActionNextTests.java   | 36 ++++++++
 .../keyboard/action/KlpActionNoneTests.java   | 36 ++++++++
 .../action/KlpActionPreviousTests.java        | 36 ++++++++
 .../keyboard/action/KlpActionSearchTests.java | 36 ++++++++
 .../keyboard/action/KlpActionSendTests.java   | 36 ++++++++
 .../keyboard/action/KlpActionTestsBase.java   | 55 ++++++++++++
 .../action/KlpActionUnspecifiedTests.java     | 37 ++++++++
 .../keyboard/action/LxxActionCustomTests.java | 37 ++++++++
 .../keyboard/action/LxxActionDoneTests.java   | 36 ++++++++
 .../keyboard/action/LxxActionGoTests.java     | 36 ++++++++
 .../keyboard/action/LxxActionNextTests.java   | 36 ++++++++
 .../keyboard/action/LxxActionNoneTests.java   | 36 ++++++++
 .../action/LxxActionPreviousTests.java        | 36 ++++++++
 .../keyboard/action/LxxActionSearchTests.java | 36 ++++++++
 .../keyboard/action/LxxActionSendTests.java   | 36 ++++++++
 .../keyboard/action/LxxActionTestsBase.java   | 26 ++++++
 .../action/LxxActionUnspecifiedTests.java     | 37 ++++++++
 23 files changed, 744 insertions(+), 211 deletions(-)
 delete mode 100644 tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java
 rename tests/src/com/android/inputmethod/keyboard/{KeyboardLayoutSetActionLabelBase.java => action/ActionTestsBase.java} (68%)
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionCustomTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionDoneTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionGoTests.java
 rename tests/src/com/android/inputmethod/keyboard/{KeyboardLayoutSetActionLabelKlpTests.java => action/KlpActionLabelTests.java} (69%)
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionNextTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionNoneTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionPreviousTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionSearchTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionSendTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionTestsBase.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/KlpActionUnspecifiedTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionCustomTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionDoneTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionGoTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionNextTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionNoneTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionPreviousTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionSearchTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionSendTests.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionTestsBase.java
 create mode 100644 tests/src/com/android/inputmethod/keyboard/action/LxxActionUnspecifiedTests.java

diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java
deleted file mode 100644
index fec501db13..0000000000
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelLxxTests.java
+++ /dev/null
@@ -1,82 +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;
-
-import android.test.suitebuilder.annotation.MediumTest;
-import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputMethodSubtype;
-
-import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
-import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
-
-@MediumTest
-public class KeyboardLayoutSetActionLabelLxxTests extends KeyboardLayoutSetActionLabelBase {
-    @Override
-    protected int getKeyboardThemeForTests() {
-        return KeyboardTheme.THEME_ID_LXX_LIGHT;
-    }
-
-    @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);
-            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);
-            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);
-            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);
-            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);
-            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_PREVIOUS, expectedKey);
-        }
-    }
-}
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelBase.java b/tests/src/com/android/inputmethod/keyboard/action/ActionTestsBase.java
similarity index 68%
rename from tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelBase.java
rename to tests/src/com/android/inputmethod/keyboard/action/ActionTestsBase.java
index 22c22a00aa..41b545aa86 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/action/ActionTestsBase.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.inputmethod.keyboard;
+package com.android.inputmethod.keyboard.action;
 
 import android.content.Context;
 import android.content.res.Resources;
@@ -22,6 +22,11 @@ import android.text.InputType;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodSubtype;
 
+import com.android.inputmethod.keyboard.Key;
+import com.android.inputmethod.keyboard.Keyboard;
+import com.android.inputmethod.keyboard.KeyboardId;
+import com.android.inputmethod.keyboard.KeyboardLayoutSet;
+import com.android.inputmethod.keyboard.KeyboardLayoutSetTestsBase;
 import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
 import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyVisual;
 import com.android.inputmethod.latin.Constants;
@@ -31,7 +36,7 @@ import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
 
 import java.util.Locale;
 
-abstract class KeyboardLayoutSetActionLabelBase extends KeyboardLayoutSetTestsBase {
+abstract class ActionTestsBase extends KeyboardLayoutSetTestsBase {
     static class ExpectedActionKey {
         static ExpectedActionKey newIconKey(final String iconName) {
             final int iconId = KeyboardIconsSet.getIconId(iconName);
@@ -72,51 +77,6 @@ abstract class KeyboardLayoutSetActionLabelBase extends KeyboardLayoutSetTestsBa
         return LocaleUtils.constructLocaleFromString(localeString);
     }
 
-    public void testActionUnspecified() {
-        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
-                KeyboardIconsSet.NAME_ENTER_KEY);
-        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
-            final String tag = "unspecifiled "
-                    + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
-            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);
-            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);
-            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEARCH, expectedKey);
-        }
-    }
-
-    public abstract void testActionGo();
-    public abstract void testActionSend();
-    public abstract void testActionNext();
-    public abstract void testActionDone();
-    public abstract void testActionPrevious();
-
-    public void testActionCustom() {
-        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
-            final String tag = "custom " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
-            final EditorInfo editorInfo = new EditorInfo();
-            editorInfo.imeOptions = EditorInfo.IME_ACTION_UNSPECIFIED;
-            editorInfo.actionLabel = "customLabel";
-            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey("customLabel");
-            doTestActionKey(tag, subtype, editorInfo, expectedKey);
-        }
-    }
-
     private static void assertActionKey(final String tag, final KeyboardLayoutSet layoutSet,
             final int elementId, final ExpectedActionKey expectedKey) {
         final Keyboard keyboard = layoutSet.getKeyboard(elementId);
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionCustomTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionCustomTests.java
new file mode 100644
index 0000000000..e7ef33015d
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionCustomTests.java
@@ -0,0 +1,37 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionCustomTests extends KlpActionTestsBase {
+    public void testActionCustom() {
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "custom " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            final EditorInfo editorInfo = new EditorInfo();
+            editorInfo.imeOptions = EditorInfo.IME_ACTION_UNSPECIFIED;
+            editorInfo.actionLabel = "customLabel";
+            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey("customLabel");
+            doTestActionKey(tag, subtype, editorInfo, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionDoneTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionDoneTests.java
new file mode 100644
index 0000000000..ada91b2e79
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionDoneTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.latin.R;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionDoneTests extends KlpActionTestsBase {
+    public void testActionDone() {
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "done " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+                    R.string.label_done_key, getLabelLocale(subtype), getContext());
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_DONE, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionGoTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionGoTests.java
new file mode 100644
index 0000000000..101523aa28
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionGoTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.latin.R;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionGoTests extends KlpActionTestsBase {
+    public void testActionGo() {
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "go " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+                    R.string.label_go_key, getLabelLocale(subtype), getContext());
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_GO, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelKlpTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionLabelTests.java
similarity index 69%
rename from tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelKlpTests.java
rename to tests/src/com/android/inputmethod/keyboard/action/KlpActionLabelTests.java
index 36b9c9cfc2..3fd3a36fcc 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetActionLabelKlpTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionLabelTests.java
@@ -14,13 +14,14 @@
  * limitations under the License.
  */
 
-package com.android.inputmethod.keyboard;
+package com.android.inputmethod.keyboard.action;
 
 import android.content.res.Resources;
 import android.test.suitebuilder.annotation.MediumTest;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodSubtype;
 
+import com.android.inputmethod.keyboard.KeyboardLayoutSet;
 import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
 import com.android.inputmethod.keyboard.internal.KeyboardTextsSet;
 import com.android.inputmethod.latin.R;
@@ -28,90 +29,11 @@ import com.android.inputmethod.latin.RichInputMethodManager;
 import com.android.inputmethod.latin.utils.RunInLocale;
 import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
 
-import java.util.ArrayList;
 import java.util.Locale;
 
 @MediumTest
-public class KeyboardLayoutSetActionLabelKlpTests extends KeyboardLayoutSetActionLabelBase {
-    // Filter a subtype whose name should be displayed using {@link Locale#ROOT}, such like
-    // Hinglish (hi_ZZ) and Serbian-Latn (sr_ZZ).
-    static final SubtypeFilter SUBTYPE_FILTER_NAME_IN_BASE_LOCALE = new SubtypeFilter() {
-        @Override
-        public boolean accept(final InputMethodSubtype subtype) {
-            return Locale.ROOT.equals(
-                    SubtypeLocaleUtils.getDisplayLocaleOfSubtypeLocale(subtype.getLocale()));
-        }
-    };
-
-    private ArrayList<InputMethodSubtype> mSubtypesWhoseNameIsDisplayedInItsLocale;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mSubtypesWhoseNameIsDisplayedInItsLocale = getSubtypesFilteredBy(new SubtypeFilter() {
-            @Override
-            public boolean accept(final InputMethodSubtype subtype) {
-                return !SUBTYPE_FILTER_NAME_IN_BASE_LOCALE.accept(subtype);
-            }
-        });
-    }
-
-    @Override
-    protected int getKeyboardThemeForTests() {
-        return KeyboardTheme.THEME_ID_KLP;
-    }
-
-    @Override
-    public void testActionGo() {
-        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
-            final String tag = "go " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
-            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
-                    R.string.label_go_key, getLabelLocale(subtype), getContext());
-            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_GO, expectedKey);
-        }
-    }
-
-    @Override
-    public void testActionSend() {
-        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
-            final String tag = "send " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
-            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
-                    R.string.label_send_key, getLabelLocale(subtype), getContext());
-            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEND, expectedKey);
-        }
-    }
-
-    @Override
-    public void testActionNext() {
-        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
-            final String tag = "next " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
-            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
-                    R.string.label_next_key, getLabelLocale(subtype), getContext());
-            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NEXT, expectedKey);
-        }
-    }
-
-    @Override
-    public void testActionDone() {
-        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
-            final String tag = "done " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
-            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
-                    R.string.label_done_key, getLabelLocale(subtype), getContext());
-            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_DONE, expectedKey);
-        }
-    }
-
-    @Override
-    public void testActionPrevious() {
-        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
-            final String tag = "previous " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
-            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,
+public class KlpActionLabelTests extends KlpActionTestsBase {
+    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,
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionNextTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionNextTests.java
new file mode 100644
index 0000000000..b24f7d01b2
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionNextTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.latin.R;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionNextTests extends KlpActionTestsBase {
+    public void testActionNext() {
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "next " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+                    R.string.label_next_key, getLabelLocale(subtype), getContext());
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NEXT, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionNoneTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionNoneTests.java
new file mode 100644
index 0000000000..18f7daf00a
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionNoneTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionNoneTests extends KlpActionTestsBase {
+    public void testActionNone() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_ENTER_KEY);
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "none " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NONE, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionPreviousTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionPreviousTests.java
new file mode 100644
index 0000000000..da449203f5
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionPreviousTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.latin.R;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionPreviousTests extends KlpActionTestsBase {
+    public void testActionPrevious() {
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "previous " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+                    R.string.label_previous_key, getLabelLocale(subtype), getContext());
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_PREVIOUS, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionSearchTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionSearchTests.java
new file mode 100644
index 0000000000..18b6daf75a
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionSearchTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionSearchTests extends KlpActionTestsBase {
+    public void testActionSearch() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_SEARCH_KEY);
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "search " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEARCH, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionSendTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionSendTests.java
new file mode 100644
index 0000000000..f3ec1735d1
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionSendTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.latin.R;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionSendTests extends KlpActionTestsBase {
+    public void testActionSend() {
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "send " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey(
+                    R.string.label_send_key, getLabelLocale(subtype), getContext());
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEND, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionTestsBase.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionTestsBase.java
new file mode 100644
index 0000000000..511f9950b4
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionTestsBase.java
@@ -0,0 +1,55 @@
+/*
+ * 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.action;
+
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.KeyboardTheme;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+import java.util.ArrayList;
+import java.util.Locale;
+
+abstract class KlpActionTestsBase extends ActionTestsBase {
+    // Filter a subtype whose name should be displayed using {@link Locale#ROOT}, such like
+    // Hinglish (hi_ZZ) and Serbian-Latn (sr_ZZ).
+    static final SubtypeFilter SUBTYPE_FILTER_NAME_IN_BASE_LOCALE = new SubtypeFilter() {
+        @Override
+        public boolean accept(final InputMethodSubtype subtype) {
+            return Locale.ROOT.equals(
+                    SubtypeLocaleUtils.getDisplayLocaleOfSubtypeLocale(subtype.getLocale()));
+        }
+    };
+
+    protected ArrayList<InputMethodSubtype> mSubtypesWhoseNameIsDisplayedInItsLocale;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        mSubtypesWhoseNameIsDisplayedInItsLocale = getSubtypesFilteredBy(new SubtypeFilter() {
+            @Override
+            public boolean accept(final InputMethodSubtype subtype) {
+                return !SUBTYPE_FILTER_NAME_IN_BASE_LOCALE.accept(subtype);
+            }
+        });
+    }
+
+    @Override
+    protected int getKeyboardThemeForTests() {
+        return KeyboardTheme.THEME_ID_KLP;
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/KlpActionUnspecifiedTests.java b/tests/src/com/android/inputmethod/keyboard/action/KlpActionUnspecifiedTests.java
new file mode 100644
index 0000000000..a465c0d1c8
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/KlpActionUnspecifiedTests.java
@@ -0,0 +1,37 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class KlpActionUnspecifiedTests extends KlpActionTestsBase {
+    public void testActionUnspecified() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_ENTER_KEY);
+        for (final InputMethodSubtype subtype : mSubtypesWhoseNameIsDisplayedInItsLocale) {
+            final String tag = "unspecifiled "
+                    + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_UNSPECIFIED, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionCustomTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionCustomTests.java
new file mode 100644
index 0000000000..3d24d63c31
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionCustomTests.java
@@ -0,0 +1,37 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionCustomTests extends LxxActionTestsBase {
+    public void testActionCustom() {
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "custom " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            final EditorInfo editorInfo = new EditorInfo();
+            editorInfo.imeOptions = EditorInfo.IME_ACTION_UNSPECIFIED;
+            editorInfo.actionLabel = "customLabel";
+            final ExpectedActionKey expectedKey = ExpectedActionKey.newLabelKey("customLabel");
+            doTestActionKey(tag, subtype, editorInfo, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionDoneTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionDoneTests.java
new file mode 100644
index 0000000000..c39839b43b
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionDoneTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionDoneTests extends LxxActionTestsBase {
+    public void testActionDone() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_DONE_KEY);
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "done " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_DONE, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionGoTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionGoTests.java
new file mode 100644
index 0000000000..4793514726
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionGoTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionGoTests extends LxxActionTestsBase {
+    public void testActionGo() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_GO_KEY);
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "go " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_GO, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionNextTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionNextTests.java
new file mode 100644
index 0000000000..37c712077d
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionNextTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionNextTests extends LxxActionTestsBase {
+    public void testActionNext() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_NEXT_KEY);
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "next " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NEXT, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionNoneTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionNoneTests.java
new file mode 100644
index 0000000000..6a2e7741b4
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionNoneTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionNoneTests extends LxxActionTestsBase {
+    public void testActionNone() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_ENTER_KEY);
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "none " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_NONE, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionPreviousTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionPreviousTests.java
new file mode 100644
index 0000000000..1917f03d8c
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionPreviousTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionPreviousTests extends LxxActionTestsBase {
+    public void testActionPrevious() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_PREVIOUS_KEY);
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "previous " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_PREVIOUS, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionSearchTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionSearchTests.java
new file mode 100644
index 0000000000..5e498e4b4d
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionSearchTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionSearchTests extends LxxActionTestsBase {
+    public void testActionSearch() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_SEARCH_KEY);
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "search " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEARCH, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionSendTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionSendTests.java
new file mode 100644
index 0000000000..722f79ed5c
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionSendTests.java
@@ -0,0 +1,36 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionSendTests extends LxxActionTestsBase {
+    public void testActionSend() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_SEND_KEY);
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "send " + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_SEND, expectedKey);
+        }
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionTestsBase.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionTestsBase.java
new file mode 100644
index 0000000000..70de9a6b8c
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionTestsBase.java
@@ -0,0 +1,26 @@
+/*
+ * 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.action;
+
+import com.android.inputmethod.keyboard.KeyboardTheme;
+
+abstract class LxxActionTestsBase extends ActionTestsBase {
+    @Override
+    protected int getKeyboardThemeForTests() {
+        return KeyboardTheme.THEME_ID_LXX_LIGHT;
+    }
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/action/LxxActionUnspecifiedTests.java b/tests/src/com/android/inputmethod/keyboard/action/LxxActionUnspecifiedTests.java
new file mode 100644
index 0000000000..00e908fd14
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/action/LxxActionUnspecifiedTests.java
@@ -0,0 +1,37 @@
+/*
+ * 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.action;
+
+import android.test.suitebuilder.annotation.MediumTest;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodSubtype;
+
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
+import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
+
+@MediumTest
+public class LxxActionUnspecifiedTests extends LxxActionTestsBase {
+    public void testActionUnspecified() {
+        final ExpectedActionKey expectedKey = ExpectedActionKey.newIconKey(
+                KeyboardIconsSet.NAME_ENTER_KEY);
+        for (final InputMethodSubtype subtype : getAllSubtypesList()) {
+            final String tag = "unspecifiled "
+                    + SubtypeLocaleUtils.getSubtypeNameForLogging(subtype);
+            doTestActionKey(tag, subtype, EditorInfo.IME_ACTION_UNSPECIFIED, expectedKey);
+        }
+    }
+}
-- 
GitLab