am 73ea3722: DO NOT MERGE Relax LocationVerifier assertions.
* commit '73ea37226aadec4a899d15e63f41e77548173b1a':
DO NOT MERGE Relax LocationVerifier assertions.
diff --git a/CtsBuild.mk b/CtsBuild.mk
index 6e57086..d396006 100644
--- a/CtsBuild.mk
+++ b/CtsBuild.mk
@@ -36,10 +36,6 @@
$(foreach lib,$(1),$(HOST_OUT_JAVA_LIBRARIES)/$(lib).jar)
endef
-define cts-get-ui-lib-paths
- $(foreach lib,$(1),$(CTS_TESTCASES_OUT)/$(lib).jar)
-endef
-
define cts-get-native-paths
$(foreach exe,$(1),$(call intermediates-dir-for,EXECUTABLES,$(exe))/$(exe))
endef
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 2b61134..5511ebd 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -38,7 +38,6 @@
CtsTestStubs \
SignatureTest \
TestDeviceSetup \
- CtsUiAutomatorApp \
$(cts_security_apps_list)
cts_external_packages := \
@@ -116,23 +115,17 @@
NativeMediaTest_SL \
NativeMediaTest_XA
-cts_ui_tests := \
- CtsUiAutomatorTests
-
# All the files that will end up under the repository/testcases
# directory of the final CTS distribution.
CTS_TEST_CASES := $(call cts-get-lib-paths,$(cts_host_libraries)) \
$(call cts-get-package-paths,$(cts_test_packages)) \
- $(call cts-get-native-paths,$(cts_native_exes)) \
- $(call cts-get-ui-lib-paths,$(cts_ui_tests))
+ $(call cts-get-native-paths,$(cts_native_exes))
# All the XMLs that will end up under the repository/testcases
# and that need to be created before making the final CTS distribution.
CTS_TEST_XMLS := $(call cts-get-test-xmls,$(cts_host_libraries)) \
$(call cts-get-test-xmls,$(cts_test_packages)) \
- $(call cts-get-test-xmls,$(cts_native_exes)) \
- $(call cts-get-test-xmls,$(cts_ui_tests))
-
+ $(call cts-get-test-xmls,$(cts_native_exes))
# The following files will be placed in the tools directory of the CTS distribution
CTS_TOOLS_LIST :=
diff --git a/apps/CtsVerifier/jni/cameraanalyzer/com_android_cts_verifier_camera_analyzer_CameraTests.cpp b/apps/CtsVerifier/jni/cameraanalyzer/com_android_cts_verifier_camera_analyzer_CameraTests.cpp
index 83f5c17..ed91233 100644
--- a/apps/CtsVerifier/jni/cameraanalyzer/com_android_cts_verifier_camera_analyzer_CameraTests.cpp
+++ b/apps/CtsVerifier/jni/cameraanalyzer/com_android_cts_verifier_camera_analyzer_CameraTests.cpp
@@ -51,7 +51,7 @@
inputBitmap,
reinterpret_cast<void**>(&inputBuffer));
- if (result != ANDROID_BITMAP_RESUT_SUCCESS) {
+ if (result != ANDROID_BITMAP_RESULT_SUCCESS) {
ALOGE("Unable to lock input bitmap");
}
@@ -106,7 +106,7 @@
long lp = (long)input_testing_image;
result = AndroidBitmap_unlockPixels(env, inputBitmap);
- if (result != ANDROID_BITMAP_RESUT_SUCCESS) {
+ if (result != ANDROID_BITMAP_RESULT_SUCCESS) {
ALOGE("Unable to unlock input bitmap");
}
@@ -200,14 +200,14 @@
outputBitmap,
reinterpret_cast<void**>(&outputBuffer) );
- if (result != ANDROID_BITMAP_RESUT_SUCCESS) {
+ if (result != ANDROID_BITMAP_RESULT_SUCCESS) {
ALOGE("Unable to lock output bitmap");
}
memcpy(outputBuffer, outputImage, outputWidth * outputHeight * 4);
result = AndroidBitmap_unlockPixels(env, outputBitmap);
- if (result != ANDROID_BITMAP_RESUT_SUCCESS) {
+ if (result != ANDROID_BITMAP_RESULT_SUCCESS) {
ALOGE("Unable to unlock output bitmap");
}
diff --git a/build/config.mk b/build/config.mk
index a121dc5..c9fa709 100644
--- a/build/config.mk
+++ b/build/config.mk
@@ -15,4 +15,3 @@
BUILD_CTS_EXECUTABLE := cts/build/test_executable.mk
BUILD_CTS_PACKAGE := cts/build/test_package.mk
BUILD_CTS_HOST_JAVA_LIBRARY := cts/build/test_host_java_library.mk
-BUILD_CTS_UI_JAVA_LIBRARY := cts/build/test_uiautomator.mk
diff --git a/build/test_uiautomator.mk b/build/test_uiautomator.mk
deleted file mode 100644
index 255f70b..0000000
--- a/build/test_uiautomator.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (C) 2012 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.
-
-#
-# Builds a uiautomator library and defines a rule to generate the associated test
-# package XML needed by CTS.
-#
-
-include $(BUILD_JAVA_LIBRARY)
-
-cts_library_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml
-cts_library_jar := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).jar
-
-$(cts_library_jar): PRIVATE_MODULE := $(LOCAL_MODULE)
-$(cts_library_jar): $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE))/javalib.jar | $(ACP)
- $(hide) mkdir -p $(CTS_TESTCASES_OUT)
- $(hide) $(ACP) -fp $(call intermediates-dir-for,JAVA_LIBRARIES,$(PRIVATE_MODULE))/javalib.jar $@
-
-$(cts_library_xml): PRIVATE_PATH := $(LOCAL_PATH)/src
-$(cts_library_xml): PRIVATE_TEST_APP_PACKAGE := $(LOCAL_CTS_TEST_APP_PACKAGE)
-$(cts_library_xml): PRIVATE_TEST_PACKAGE := $(LOCAL_CTS_TEST_PACKAGE)
-$(cts_library_xml): PRIVATE_TEST_APK := $(LOCAL_CTS_TEST_APK)
-$(cts_library_xml): PRIVATE_LIBRARY := $(LOCAL_MODULE)
-$(cts_library_xml): PRIVATE_JAR_PATH := $(LOCAL_MODULE).jar
-$(cts_library_xml): $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE))/javalib.jar $(CTS_EXPECTATIONS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR)
- $(hide) echo Generating test description for uiautomator library $(PRIVATE_LIBRARY)
- $(hide) mkdir -p $(CTS_TESTCASES_OUT)
- $(hide) $(CTS_JAVA_TEST_SCANNER) -s $(PRIVATE_PATH) \
- -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \
- $(CTS_XML_GENERATOR) -t uiAutomator \
- -i $(PRIVATE_TEST_APK) \
- -j $(PRIVATE_JAR_PATH) \
- -a $(PRIVATE_TEST_PACKAGE) \
- -n $(PRIVATE_LIBRARY) \
- -p $(PRIVATE_TEST_PACKAGE) \
- -r $(PRIVATE_TEST_APP_PACKAGE) \
- -e $(CTS_EXPECTATIONS) \
- -o $@
diff --git a/tests/jni/android_os_cts_CpuFeatures.cpp b/tests/jni/android_os_cts_CpuFeatures.cpp
index 95a0d2f..49d9725 100644
--- a/tests/jni/android_os_cts_CpuFeatures.cpp
+++ b/tests/jni/android_os_cts_CpuFeatures.cpp
@@ -30,11 +30,19 @@
return (cpuFeatures & ANDROID_CPU_ARM_FEATURE_ARMv7) == ANDROID_CPU_ARM_FEATURE_ARMv7;
}
+jboolean android_os_cts_CpuFeatures_isMipsCpu(JNIEnv* env, jobject thiz)
+{
+ AndroidCpuFamily cpuFamily = android_getCpuFamily();
+ return cpuFamily == ANDROID_CPU_FAMILY_MIPS;
+}
+
static JNINativeMethod gMethods[] = {
{ "isArmCpu", "()Z",
(void *) android_os_cts_CpuFeatures_isArmCpu },
{ "isArm7Compatible", "()Z",
(void *) android_os_cts_CpuFeatures_isArm7Compatible },
+ { "isMipsCpu", "()Z",
+ (void *) android_os_cts_CpuFeatures_isMipsCpu },
};
int register_android_os_cts_CpuFeatures(JNIEnv* env)
diff --git a/tests/src/android/os/cts/CpuFeatures.java b/tests/src/android/os/cts/CpuFeatures.java
index f87db6a..7b8fd38 100644
--- a/tests/src/android/os/cts/CpuFeatures.java
+++ b/tests/src/android/os/cts/CpuFeatures.java
@@ -22,6 +22,8 @@
public static final String ARMEABI = "armeabi";
+ public static final String MIPSABI = "mips";
+
static {
System.loadLibrary("cts_jni");
}
@@ -29,4 +31,6 @@
public static native boolean isArmCpu();
public static native boolean isArm7Compatible();
+
+ public static native boolean isMipsCpu();
}
diff --git a/tests/tests/os/src/android/os/cts/NoExecutePermissionTest.java b/tests/tests/os/src/android/os/cts/NoExecutePermissionTest.java
index 6256267..43afb53 100644
--- a/tests/tests/os/src/android/os/cts/NoExecutePermissionTest.java
+++ b/tests/tests/os/src/android/os/cts/NoExecutePermissionTest.java
@@ -75,6 +75,10 @@
// http://code.google.com/p/android/issues/detail?id=17328
return false;
}
+ if (CpuFeatures.isMipsCpu()) {
+ // MIPS processors do not have NX support.
+ return false;
+ }
// TODO: handle other processors. For now, assume those processors
// have NX support.
diff --git a/tests/tests/security/src/android/security/cts/BannedFilesTest.java b/tests/tests/security/src/android/security/cts/BannedFilesTest.java
index b4deed5..ada9aaf 100644
--- a/tests/tests/security/src/android/security/cts/BannedFilesTest.java
+++ b/tests/tests/security/src/android/security/cts/BannedFilesTest.java
@@ -22,6 +22,18 @@
public class BannedFilesTest extends TestCase {
+ /**
+ * Detect devices vulnerable to the cmdclient privilege escalation bug.
+ *
+ * References:
+ *
+ * http://vulnfactory.org/blog/2012/02/18/xoom-fe-stupid-bugs-and-more-plagiarism/
+ * http://forum.xda-developers.com/showthread.php?t=1213014
+ */
+ public void testNoCmdClient() {
+ assertNotSetugid("/system/bin/cmdclient");
+ }
+
public void testNoSyncAgent() {
assertNotSetugid("/system/bin/sync_agent");
}
diff --git a/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java b/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
index 420af25..e65561e 100644
--- a/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
+++ b/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
@@ -119,19 +119,32 @@
mBaseTime - DAY_DURATION).toString());
}
+ public void test_formatElapsedTime() {
+ if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) {
+ return;
+ }
+
+ long MINUTES = 60;
+ long HOURS = 60 * MINUTES;
+ test_formatElapsedTime("02:01", 2 * MINUTES + 1);
+ test_formatElapsedTime("3:02:01", 3 * HOURS + 2 * MINUTES + 1);
+ // http://code.google.com/p/android/issues/detail?id=41401
+ test_formatElapsedTime("123:02:01", 123 * HOURS + 2 * MINUTES + 1);
+ }
+
+ private void test_formatElapsedTime(String expected, long elapsedTime) {
+ assertEquals(expected, DateUtils.formatElapsedTime(elapsedTime));
+ StringBuilder sb = new StringBuilder();
+ assertEquals(expected, DateUtils.formatElapsedTime(sb, elapsedTime));
+ assertEquals(expected, sb.toString());
+ }
+
@SuppressWarnings("deprecation")
public void testFormatMethods() {
if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) {
return;
}
- long elapsedTime = 2 * 60 * 60;
- String expected = "2:00:00";
- assertEquals(expected, DateUtils.formatElapsedTime(elapsedTime));
- StringBuilder sb = new StringBuilder();
- assertEquals(expected, DateUtils.formatElapsedTime(sb, elapsedTime));
- assertEquals(expected, sb.toString());
-
Date date = new Date(109, 0, 19, 3, 30, 15);
long fixedTime = date.getTime();
diff --git a/tests/tests/widget/src/android/widget/cts/HeaderViewListAdapterTest.java b/tests/tests/widget/src/android/widget/cts/HeaderViewListAdapterTest.java
index e583dce..5426ae9 100644
--- a/tests/tests/widget/src/android/widget/cts/HeaderViewListAdapterTest.java
+++ b/tests/tests/widget/src/android/widget/cts/HeaderViewListAdapterTest.java
@@ -81,6 +81,21 @@
HeaderViewFullAdapter fullAdapter = new HeaderViewFullAdapter();
headerViewListAdapter = new HeaderViewListAdapter(null, null, fullAdapter);
assertFalse(headerViewListAdapter.isEmpty());
+
+ ListView lv = new ListView(getContext());
+ ArrayList<ListView.FixedViewInfo> header = new ArrayList<ListView.FixedViewInfo>(4);
+ header.add(lv.new FixedViewInfo());
+ headerViewListAdapter = new HeaderViewListAdapter(header, null, null);
+ assertEquals(1, headerViewListAdapter.getHeadersCount());
+ assertFalse(headerViewListAdapter.isEmpty());
+
+ lv = new ListView(getContext());
+ ArrayList<ListView.FixedViewInfo> footer = new ArrayList<ListView.FixedViewInfo>(4);
+ footer.add(lv.new FixedViewInfo());
+ headerViewListAdapter = new HeaderViewListAdapter(null, footer, null);
+ assertEquals(1, headerViewListAdapter.getFootersCount());
+ assertFalse(headerViewListAdapter.isEmpty());
+
}
public void testRemoveHeader() {
diff --git a/tests/uiautomator/test-apps/Android.mk b/tests/uiautomator/test-apps/Android.mk
deleted file mode 100644
index e790e1e..0000000
--- a/tests/uiautomator/test-apps/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2012 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.
-
-include $(call all-subdir-makefiles)
diff --git a/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java b/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
index 25a4ec1..ba87156 100644
--- a/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
+++ b/tools/cts-java-scanner/src/com/android/cts/javascanner/DocletRunner.java
@@ -72,7 +72,6 @@
// PTS adds PtsAndroidTestCase
sourcePath.add("./cts/suite/pts/deviceTests/ptsutil/src");
sourcePath.add("./cts/libs/util/src");
- sourcePath.add("./frameworks/testing/uiautomator/library/src");
sourcePath.add(sourceDir.toString());
return join(sourcePath, ":");
}
diff --git a/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/CtsXmlGenerator.java b/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/CtsXmlGenerator.java
index c5b253a..ce4fdd7 100644
--- a/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/CtsXmlGenerator.java
+++ b/tools/cts-xml-generator/src/com/android/cts/xmlgenerator/CtsXmlGenerator.java
@@ -49,8 +49,6 @@
String instrumentation = null;
String testType = null;
String jarPath = null;
- String appNameSpace = null;
- String targetNameSpace = null;
for (int i = 0; i < args.length; i++) {
if ("-p".equals(args[i])) {
@@ -70,17 +68,15 @@
"Missing value for expectation store")));
} else if ("-o".equals(args[i])) {
outputPath = getArg(args, ++i, "Missing value for output file");
- } else if ("-a".equals(args[i])) {
- appNameSpace = getArg(args, ++i, "Missing value for app name space");
- } else if ("-r".equals(args[i])) {
- targetNameSpace = getArg(args, ++i, "Missing value for target name space");
} else {
System.err.println("Unsupported flag: " + args[i]);
usage(args);
}
}
+ String appNameSpace = null;
String runner = null;
+ String targetNameSpace = null;
if (manifestFile != null) {
Document manifest = DocumentBuilderFactory.newInstance().newDocumentBuilder()
diff --git a/tools/tradefed-host/.classpath b/tools/tradefed-host/.classpath
index 09dd0ce..275ecf9 100644
--- a/tools/tradefed-host/.classpath
+++ b/tools/tradefed-host/.classpath
@@ -3,10 +3,10 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="res"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/tradefederation"/>
<classpathentry exported="true" kind="var" path="CTS_SRC_ROOT/out/host/common/obj/JAVA_LIBRARIES/ctsdeviceinfolib_intermediates/javalib.jar"/>
<classpathentry exported="true" kind="var" path="CTS_SRC_ROOT/out/host/common/obj/JAVA_LIBRARIES/hosttestlib_intermediates/javalib.jar"/>
- <classpathentry kind="var" path="CTS_SRC_ROOT/prebuilt/common/ddmlib/ddmlib-prebuilt.jar" sourcepath="/SDK_SRC_ROOT"/>
- <classpathentry kind="var" path="CTS_SRC_ROOT/prebuilt/common/tradefed/tradefed-prebuilt.jar" sourcepath="/TRADEFED_ROOT/tools/tradefederation/src"/>
- <classpathentry kind="var" path="CTS_SRC_ROOT/out/host/common/obj/JAVA_LIBRARIES/junit_intermediates/javalib.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/tools/tradefed-host/.gitignore b/tools/tradefed-host/.gitignore
deleted file mode 100644
index ba077a4..0000000
--- a/tools/tradefed-host/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/targetprep/SettingsToggler.java b/tools/tradefed-host/src/com/android/cts/tradefed/targetprep/SettingsToggler.java
index 597d866..69d4c8a 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/targetprep/SettingsToggler.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/targetprep/SettingsToggler.java
@@ -51,7 +51,7 @@
"content update"
+ " --uri content://settings/secure"
+ " --bind value:s:" + value
- + " --where \"name=\\'" + name + "\\'\"");
+ + " --where \"name='" + name + "'\"");
}
public static void updateSecureInt(ITestDevice device, String name, int value)
@@ -60,7 +60,7 @@
"content update"
+ " --uri content://settings/secure"
+ " --bind value:i:" + value
- + " --where \"name=\\'" + name + "\\'\"");
+ + " --where \"name='" + name + "'\"");
}
private static void deleteSecure(ITestDevice device, String name)
@@ -68,6 +68,6 @@
device.executeShellCommand(
"content delete"
+ " --uri content://settings/secure"
- + " --where \"name=\\'" + name + "\\'\"");
+ + " --where \"name='" + name + "'\"");
}
}
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
index db11bce..19ee3b7 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/CtsTest.java
@@ -400,7 +400,8 @@
// reboot it before running it.
// Also reboot after package which is know to leave pop-up behind
final List<String> rebootAfterList = Arrays.asList(
- "CtsMediaTestCases");
+ "CtsMediaTestCases",
+ "CtsAccessibilityTestCases");
final List<String> rebootBeforeList = Arrays.asList(
"CtsAnimationTestCases",
"CtsGraphicsTestCases",
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
index 78a72ba..ffbb930 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
@@ -16,7 +16,6 @@
package com.android.cts.tradefed.testtype;
-import com.android.ddmlib.Log.LogLevel;
import com.android.ddmlib.testrunner.TestIdentifier;
import com.android.tradefed.log.LogUtil.CLog;
import com.android.tradefed.testtype.IRemoteTest;
@@ -49,7 +48,6 @@
"com.android.cts.tradefed.testtype.AccessibilityTestRunner";
public static final String ACCESSIBILITYSERVICE_TEST =
"com.android.cts.tradefed.testtype.AccessibilityServiceTestRunner";
- public static final String UIAUTOMATOR_TEST = "uiAutomator";
private static final String SIGNATURE_TEST_METHOD = "testSignature";
private static final String SIGNATURE_TEST_CLASS = "android.tests.sigtest.SimpleSignatureTest";
@@ -227,9 +225,6 @@
} else if (ACCESSIBILITYSERVICE_TEST.equals(mTestType)) {
AccessibilityServiceTestRunner test = new AccessibilityServiceTestRunner();
return setInstrumentationTest(test, testCaseDir);
- } else if (UIAUTOMATOR_TEST.equals(mTestType)) {
- UiAutomatorJarTest uiautomatorTest = new UiAutomatorJarTest();
- return setUiAutomatorTest(uiautomatorTest);
} else if (mIsSignatureTest) {
// TODO: hardcode the runner/class/method for now, since current package xml points to
// specialized instrumentation. Eventually this special case for signatureTest can be
@@ -290,28 +285,6 @@
}
/**
- * Populates given {@link UiAutomatorJarTest} with data from the package xml.
- *
- * @param uiautomatorTest
- * @return the populated {@link UiAutomatorJarTest} or <code>null</code>
- */
- private IRemoteTest setUiAutomatorTest(UiAutomatorJarTest uiautomatorTest) {
- uiautomatorTest.setInstallArtifacts(getJarPath());
- if (mClassName != null) {
- if (mMethodName != null) {
- CLog.logAndDisplay(LogLevel.WARN, "ui automator tests don't currently support" +
- "running individual methods");
- }
- uiautomatorTest.addClassName(mClassName);
- } else {
- uiautomatorTest.addClassNames(mTestClasses);
- }
- uiautomatorTest.setRunName(getUri());
- uiautomatorTest.setCaptureLogs(false);
- return uiautomatorTest;
- }
-
- /**
* Filter the tests to run based on list of excluded tests, class and method name.
*
* @return the filtered collection of tests
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/UiAutomatorJarTest.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/UiAutomatorJarTest.java
deleted file mode 100644
index 83cc6d6..0000000
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/UiAutomatorJarTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2011 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.cts.tradefed.testtype;
-
-import com.android.cts.tradefed.build.CtsBuildHelper;
-import com.android.tradefed.build.IBuildInfo;
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.log.LogUtil.CLog;
-import com.android.tradefed.result.ITestInvocationListener;
-import com.android.tradefed.testtype.IBuildReceiver;
-import com.android.tradefed.testtype.UiAutomatorTest;
-
-import java.io.FileNotFoundException;
-import java.util.Arrays;
-
-import junit.framework.Assert;
-
-/**
- * A {@link UiAutomatorTest} that will install a uiautomator jar before test
- * execution, and uninstall on execution completion.
- */
-public class UiAutomatorJarTest extends UiAutomatorTest implements IBuildReceiver {
-
- // TODO: expose this in parent
- private static final String SHELL_EXE_BASE = "/data/local/tmp/";
-
- /** the file names of the CTS jar to install */
- private String mTestJarFileName;
-
- private CtsBuildHelper mCtsBuild = null;
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setBuild(IBuildInfo build) {
- mCtsBuild = CtsBuildHelper.createBuildHelper(build);
- }
-
- /**
- * Setter for CTS build files needed to perform the test.
- *
- * @param testJarName the file name of the jar containing the uiautomator tests
- */
- public void setInstallArtifacts(String testJarName) {
- mTestJarFileName = testJarName;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void run(final ITestInvocationListener listener)
- throws DeviceNotAvailableException {
- Assert.assertNotNull("missing device", getDevice());
- Assert.assertNotNull("missing build", mCtsBuild);
- Assert.assertNotNull("missing jar to install", mTestJarFileName);
-
- installJar();
-
- super.run(listener);
-
- uninstallJar();
- }
-
- private void installJar() throws DeviceNotAvailableException {
- CLog.d("Installing %s on %s", mTestJarFileName, getDevice().getSerialNumber());
- String fullJarPath = String.format("%s%s", SHELL_EXE_BASE, mTestJarFileName);
- try {
- boolean result = getDevice().pushFile(mCtsBuild.getTestApp(mTestJarFileName),
- fullJarPath);
- Assert.assertTrue(String.format("Failed to push file to %s", fullJarPath), result);
- setTestJarPaths(Arrays.asList(fullJarPath));
- } catch (FileNotFoundException e) {
- Assert.fail(String.format("Could not find file %s", mTestJarFileName));
- }
- }
-
- private void uninstallJar() throws DeviceNotAvailableException {
- CLog.d("Uninstalling %s on %s", mTestJarFileName, getDevice().getSerialNumber());
- String fullJarPath = String.format("%s%s", SHELL_EXE_BASE, mTestJarFileName);
- getDevice().executeShellCommand(String.format("rm %s", fullJarPath));
- }
-}
diff --git a/tools/vm-tests-tf/src/dot/junit/opcodes/invoke_interface/Test_invoke_interface.java b/tools/vm-tests-tf/src/dot/junit/opcodes/invoke_interface/Test_invoke_interface.java
index 377cc58..ae06cda 100644
--- a/tools/vm-tests-tf/src/dot/junit/opcodes/invoke_interface/Test_invoke_interface.java
+++ b/tools/vm-tests-tf/src/dot/junit/opcodes/invoke_interface/Test_invoke_interface.java
@@ -90,6 +90,29 @@
}
/**
+ * @title dvmInterpFindInterfaceMethod failures were putting NULL Method*s
+ * in the interface cache, leading to a null pointer deference the second
+ * time you made the same bad call, with no exception thrown.
+ * See http://code.google.com/p/android/issues/detail?id=29358 for details.
+ */
+ public void testE4_2() {
+ //@uses dot.junit.opcodes.invoke_interface.d.T_invoke_interface_11
+ //@uses dot.junit.opcodes.invoke_interface.ITest
+ //@uses dot.junit.opcodes.invoke_interface.ITestImpl
+ T_invoke_interface_11 t = new T_invoke_interface_11();
+ try {
+ t.run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError expected) {
+ }
+ try {
+ t.run();
+ fail("expected IncompatibleClassChangeError");
+ } catch (IncompatibleClassChangeError expected) {
+ }
+ }
+
+ /**
* @title Native method can't be linked
*/
public void testE5() {