From 9a5bf1d12ea3c8714e5702cdb07753e0325185ac Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 12 Jun 2012 11:23:56 -0700 Subject: [PATCH] Use InstrumentationTestCase and get rid of AndroidTestCase.getTestContext call Bug: 6202480 Change-Id: I19e04f17614e70867f8383d08667e350d753cde9 --- .../keyboard/internal/KeySpecParserCsvTests.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java index fa067f4c8..3dc4543c2 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java @@ -16,25 +16,27 @@ package com.android.inputmethod.keyboard.internal; -import android.test.AndroidTestCase; +import android.app.Instrumentation; +import android.test.InstrumentationTestCase; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.Locale; -public class KeySpecParserCsvTests extends AndroidTestCase { +public class KeySpecParserCsvTests extends InstrumentationTestCase { private final KeyboardTextsSet mTextsSet = new KeyboardTextsSet(); @Override protected void setUp() throws Exception { super.setUp(); + final Instrumentation instrumentation = getInstrumentation(); mTextsSet.setLanguage(Locale.ENGLISH.getLanguage()); - mTextsSet.loadStringResources(getContext()); + mTextsSet.loadStringResources(instrumentation.getTargetContext()); final String[] testResourceNames = getAllResourceIdNames( com.android.inputmethod.latin.tests.R.string.class); - mTextsSet.loadStringResourcesInternal(getTestContext(), + mTextsSet.loadStringResourcesInternal(instrumentation.getContext(), testResourceNames, com.android.inputmethod.latin.tests.R.string.empty_string); }