From bfa5581857086948ffa5d732e4a095d548b218f6 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 5 Jul 2018 13:44:00 -0700 Subject: Migrate to Android Testing Support Lib (part 2/N) This CL converts tests under com.android.inputmethod.compat 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.compat Change-Id: I6766447ca27f5cccdb1e9f7e751235daa04cc252 --- .../inputmethod/compat/TextInfoCompatUtilsTests.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tests/src/com/android/inputmethod/compat/TextInfoCompatUtilsTests.java') diff --git a/tests/src/com/android/inputmethod/compat/TextInfoCompatUtilsTests.java b/tests/src/com/android/inputmethod/compat/TextInfoCompatUtilsTests.java index c399cced6..ec7c2ab6e 100644 --- a/tests/src/com/android/inputmethod/compat/TextInfoCompatUtilsTests.java +++ b/tests/src/com/android/inputmethod/compat/TextInfoCompatUtilsTests.java @@ -16,10 +16,12 @@ package com.android.inputmethod.compat; +import static org.junit.Assert.assertTrue; + import android.graphics.Typeface; import android.os.Parcel; -import android.test.AndroidTestCase; -import android.test.suitebuilder.annotation.SmallTest; +import android.support.test.filters.SmallTest; +import android.support.test.runner.AndroidJUnit4; import android.text.SpannableString; import android.text.Spanned; import android.text.TextUtils; @@ -29,8 +31,13 @@ import android.view.textservice.TextInfo; import java.util.Arrays; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + @SmallTest -public class TextInfoCompatUtilsTests extends AndroidTestCase { +@RunWith(AndroidJUnit4.class) +public class TextInfoCompatUtilsTests { final private static String TEST_TEXT = "0123456789"; final private static int TEST_COOKIE = 0x1234; final private static int TEST_SEQUENCE_NUMBER = 0x4321; @@ -45,6 +52,7 @@ public class TextInfoCompatUtilsTests extends AndroidTestCase { final private static int TEST_URL_SPAN_END = 7; final private static int TEST_URL_SPAN_FLAGS = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE; + @Test public void testGetCharSequence() { final SpannableString text = new SpannableString(TEST_TEXT); text.setSpan(TEST_STYLE_SPAN, TEST_STYLE_SPAN_START, TEST_STYLE_SPAN_END, -- cgit v1.2.3-83-g751a