Move IME related unit tests under core/tests/coretests/.

This CL moves existing (non-CTS) unit tests used for input
method under core/tests/coretests/ to reduce the maintenance
cost.

Although some package names and import lines are updated
to be consistent with new file locations, test cases are
are kept to be the same.

Change-Id: I4efce90b232458212ac48292dc01b812a9e851e5
This commit is contained in:
Yohei Yukawa
2015-08-12 20:14:08 -07:00
parent 8cf6d865cf
commit 35f743713d
9 changed files with 12 additions and 86 deletions

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package android.os;
package android.view.inputmethod;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.os.Parcel;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.text.TextUtils;
import android.view.inputmethod.CursorAnchorInfo;
import android.view.inputmethod.CursorAnchorInfo.Builder;
import java.util.Objects;

View File

@@ -14,12 +14,11 @@
* limitations under the License.
*/
package android.os;
package android.view.inputmethod;
import android.os.Parcel;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.view.inputmethod.InputMethodSubtype;
import android.view.inputmethod.InputMethodSubtypeArray;
import android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder;
import java.util.ArrayList;

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package android.os;
package android.view.inputmethod;
import android.os.Parcel;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.view.inputmethod.InputMethodSubtype;
import android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder;
import java.util.Objects;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package android.os;
package android.view.inputmethod;
import android.graphics.RectF;
import android.os.Parcel;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.view.inputmethod.SparseRectFArray;
import android.view.inputmethod.SparseRectFArray.SparseRectFArrayBuilder;
import java.util.Objects;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package android.os;
package com.android.internal.inputmethod;
import android.content.pm.ApplicationInfo;
import android.content.pm.ResolveInfo;

View File

@@ -14,26 +14,25 @@
* limitations under the License.
*/
package android.os;
package com.android.internal.inputmethod;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.os.Parcel;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodSubtype;
import android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder;
import com.android.internal.inputmethod.InputMethodUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
public class InputMethodTest extends InstrumentationTestCase {
public class InputMethodUtilsTest extends InstrumentationTestCase {
private static final boolean IS_AUX = true;
private static final boolean IS_DEFAULT = true;
private static final boolean IS_OVERRIDES_IMPLICITLY_ENABLED_SUBTYPE = true;

View File

@@ -1,18 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
# Include all test java files.
LOCAL_SRC_FILES := \
$(call all-java-files-under, src)
LOCAL_DX_FLAGS := --core-library
LOCAL_STATIC_JAVA_LIBRARIES := core-tests android-common frameworks-core-util-lib
LOCAL_JAVA_LIBRARIES := android.test.runner
LOCAL_PACKAGE_NAME := FrameworksCoreInputMethodTests
LOCAL_CERTIFICATE := platform
include $(BUILD_PACKAGE)

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="internalOnly"
package="com.android.frameworks.coretests.inputmethod"
android:sharedUserId="android.uid.system">
<application>
<uses-library android:name="android.test.runner" />
</application>
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.android.frameworks.coretests.inputmethod"
android:label="Frameworks InputMethod Core Tests" />
</manifest>

View File

@@ -1,24 +0,0 @@
#!/bin/bash
while [[ $# -gt 0 ]]; do
case "$1" in
--rebuild ) echo Rebuild && rebuild=true;;
* ) com_opts+=($1);;
esac
shift
done
if [[ -z $ANDROID_PRODUCT_OUT && $rebuilld == true ]]; then
echo You must lunch before running this test.
exit 0
fi
if [[ $rebuild == true ]]; then
make -j4 FrameworksCoreInputMethodTests
TESTAPP=${ANDROID_PRODUCT_OUT}/data/app/FrameworksCoreInputMethodTests/FrameworksCoreInputMethodTests.apk
COMMAND="adb install -r $TESTAPP"
echo $COMMAND
$COMMAND
fi
adb shell am instrument -w -e class android.os.InputMethodTest,android.os.InputMethodSubtypeTest,android.os.InputMethodSubtypeArrayTest,android.os.InputMethodSubtypeSwitchingControllerTest,android.os.CursorAnchorInfoTest,android.os.SparseRectFArrayTest com.android.frameworks.coretests.inputmethod/android.test.InstrumentationTestRunner