aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelperTests.java
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2018-07-06 10:10:54 -0700
committerYohei Yukawa <yukawa@google.com>2018-07-06 10:10:54 -0700
commitd3b93cc95061ada6a162d7989e313f818e6d4e15 (patch)
treea4e3eaee6b84d20817d82b2a263e0e47bcc98753 /tests/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelperTests.java
parenta497886dda70bbd401652560d11d8f4010985e96 (diff)
downloadlatinime-d3b93cc95061ada6a162d7989e313f818e6d4e15.tar.gz
latinime-d3b93cc95061ada6a162d7989e313f818e6d4e15.tar.xz
latinime-d3b93cc95061ada6a162d7989e313f818e6d4e15.zip
Migrate to Android Testing Support Lib (part 5/N)
This CL converts 19 test classes under com.android.inputmethod.latin to Android Testing Support Library. Bug: 110805255 Test: verified as follows. No new test failures. tapas adb LatinIME LatinIMETests arm64 userdebug && \ DISABLE_PROGUARD=true make -j LatinIME && \ adb install -r $OUT/system/app/LatinIME/LatinIME.apk && \ atest LatinIMETests:com.android.inputmethod.latin Change-Id: I878fcae0126f57c43a644af341e5a0a8ac8f5cc9
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelperTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelperTests.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelperTests.java b/tests/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelperTests.java
index f3273a2d1..b44a9290b 100644
--- a/tests/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelperTests.java
+++ b/tests/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelperTests.java
@@ -16,13 +16,22 @@
package com.android.inputmethod.latin.suggestions;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
+import static junit.framework.TestCase.assertEquals;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
import com.android.inputmethod.latin.SuggestedWords;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
@SmallTest
-public class SuggestionStripLayoutHelperTests extends AndroidTestCase {
+@RunWith(AndroidJUnit4.class)
+public class SuggestionStripLayoutHelperTests {
private static void confirmShowTypedWord(final String message, final int inputType) {
assertFalse(message, SuggestionStripLayoutHelper.shouldOmitTypedWord(
inputType,
@@ -42,6 +51,7 @@ public class SuggestionStripLayoutHelperTests extends AndroidTestCase {
true /* shouldShowUiToAcceptTypedWord */));
}
+ @Test
public void testShouldShowTypedWord() {
confirmShowTypedWord("no input style",
SuggestedWords.INPUT_STYLE_NONE);
@@ -51,7 +61,8 @@ public class SuggestionStripLayoutHelperTests extends AndroidTestCase {
SuggestedWords.INPUT_STYLE_RECORRECTION);
}
- public void testshouldOmitTypedWordWhileTyping() {
+ @Test
+ public void testShouldOmitTypedWordWhileTyping() {
assertFalse("typing", SuggestionStripLayoutHelper.shouldOmitTypedWord(
SuggestedWords.INPUT_STYLE_TYPING,
false /* gestureFloatingPreviewTextEnabled */,
@@ -70,7 +81,8 @@ public class SuggestionStripLayoutHelperTests extends AndroidTestCase {
true /* shouldShowUiToAcceptTypedWord */));
}
- public void testshouldOmitTypedWordWhileGesturing() {
+ @Test
+ public void testShouldOmitTypedWordWhileGesturing() {
assertFalse("gesturing", SuggestionStripLayoutHelper.shouldOmitTypedWord(
SuggestedWords.INPUT_STYLE_UPDATE_BATCH,
false /* gestureFloatingPreviewTextEnabled */,
@@ -89,7 +101,8 @@ public class SuggestionStripLayoutHelperTests extends AndroidTestCase {
true /* shouldShowUiToAcceptTypedWord */));
}
- public void testshouldOmitTypedWordWhenGestured() {
+ @Test
+ public void testShouldOmitTypedWordWhenGestured() {
assertFalse("gestured", SuggestionStripLayoutHelper.shouldOmitTypedWord(
SuggestedWords.INPUT_STYLE_TAIL_BATCH,
false /* gestureFloatingPreviewTextEnabled */,
@@ -115,6 +128,7 @@ public class SuggestionStripLayoutHelperTests extends AndroidTestCase {
private static final int POSITION_CENTER = 1;
private static final int POSITION_RIGHT = 2;
+ @Test
public void testGetPositionInSuggestionStrip() {
assertEquals("1st word without auto correction", POSITION_CENTER,
SuggestionStripLayoutHelper.getPositionInSuggestionStrip(