Build app and accessibility CTS suites against public APIs
Remove CTS tests for private methods and classes in app package. Updates
Android.mk files to build against public APIs.
Bug: 13281485
Change-Id: I15e6b4c6d1ddbf9d8f59ac3070d666033ab0d6ec
diff --git a/tests/tests/accessibility/Android.mk b/tests/tests/accessibility/Android.mk
index bb943ee..263c47b 100644
--- a/tests/tests/accessibility/Android.mk
+++ b/tests/tests/accessibility/Android.mk
@@ -26,4 +26,6 @@
LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil ctstestrunner
+LOCAL_SDK_VERSION := current
+
include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/app/Android.mk b/tests/tests/app/Android.mk
index 4a3d31f..301f931 100644
--- a/tests/tests/app/Android.mk
+++ b/tests/tests/app/Android.mk
@@ -31,4 +31,6 @@
LOCAL_INSTRUMENTATION_FOR := CtsAppTestStubs
+LOCAL_SDK_VERSION := current
+
include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/app/src/android/app/cts/AlertDialog_BuilderTest.java b/tests/tests/app/src/android/app/cts/AlertDialog_BuilderTest.java
index 9554438..58e69b8 100644
--- a/tests/tests/app/src/android/app/cts/AlertDialog_BuilderTest.java
+++ b/tests/tests/app/src/android/app/cts/AlertDialog_BuilderTest.java
@@ -577,26 +577,6 @@
assertEquals(view, mView);
}
- public void testSetViewCustom() throws Throwable {
- final int viewSpacingLeft = 10;
- final int viewSpacingTop = 20;
- final int viewSpacingRight = 30;
- final int viewSpacingBottom = 40;
- final View view = new View(mContext);
- view.setId(100);
- runTestOnUiThread(new Runnable() {
- public void run() {
- mBuilder = new AlertDialog.Builder(mContext);
- mBuilder.setView(view, viewSpacingLeft, viewSpacingTop, viewSpacingRight,
- viewSpacingBottom);
- mDialog = mBuilder.show();
- mView = mDialog.getWindow().findViewById(100);
- }
- });
- mInstrumentation.waitForIdleSync();
- assertEquals(view, mView);
- }
-
public void testSetInverseBackgroundForced() throws Throwable {
runTestOnUiThread(new Runnable() {
public void run() {
diff --git a/tests/tests/app/src/android/app/cts/InstrumentationTest.java b/tests/tests/app/src/android/app/cts/InstrumentationTest.java
index b21148e..25403f3 100644
--- a/tests/tests/app/src/android/app/cts/InstrumentationTest.java
+++ b/tests/tests/app/src/android/app/cts/InstrumentationTest.java
@@ -540,7 +540,6 @@
public void openPanel(int featureId, KeyEvent event) {
}
- @Override
public void alwaysReadCloseOnTouchAttr() {
}
diff --git a/tests/tests/app/src/android/app/cts/NotificationTest.java b/tests/tests/app/src/android/app/cts/NotificationTest.java
index 17f433e..6179922 100644
--- a/tests/tests/app/src/android/app/cts/NotificationTest.java
+++ b/tests/tests/app/src/android/app/cts/NotificationTest.java
@@ -166,16 +166,6 @@
assertNotNull(mNotification.contentView);
}
- public void testSetLatestEventInfo() {
- mNotification = new Notification();
- mNotification.icon = 1;
- final Intent intent = new Intent();
- final PendingIntent contentIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);
- mNotification.setLatestEventInfo(mContext, CONTENT_TITLE, CONTENT_TEXT, contentIntent);
- assertTrue(mNotification.contentView instanceof RemoteViews);
- assertNotNull(mNotification.contentView);
- }
-
public void testToString() {
mNotification = new Notification();
assertNotNull(mNotification.toString());
diff --git a/tests/tests/app/src/android/app/cts/SearchDialogTest.java b/tests/tests/app/src/android/app/cts/SearchDialogTest.java
deleted file mode 100644
index 1cf1ebd..0000000
--- a/tests/tests/app/src/android/app/cts/SearchDialogTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2015 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 android.app.cts;
-
-import android.app.SearchDialog;
-import android.content.Context;
-import android.test.ActivityInstrumentationTestCase2;
-import android.test.InstrumentationTestCase;
-import android.view.ActionMode;
-import android.view.View;
-import android.view.ViewGroup;
-
-/**
- * Test {@link SearchDialog}.
- */
-public class SearchDialogTest extends InstrumentationTestCase {
-
- private Context mContext;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mContext = getInstrumentation().getTargetContext();
- }
-
- public void testPrimaryActionModesAreStopped() {
- SearchDialog.SearchBar searchBar = new SearchDialog.SearchBar(mContext);
- MockViewGroup viewGroup = new MockViewGroup(mContext);
- viewGroup.addView(searchBar);
-
- ActionMode mode = searchBar.startActionModeForChild(null, null, ActionMode.TYPE_PRIMARY);
-
- assertNull(mode);
- // Should not bubble up.
- assertFalse(viewGroup.isStartActionModeForChildTypedCalled);
- assertFalse(viewGroup.isStartActionModeForChildTypelessCalled);
-
- mode = searchBar.startActionModeForChild(null, null);
-
- assertNull(mode);
- // Should not bubble up.
- assertFalse(viewGroup.isStartActionModeForChildTypedCalled);
- assertFalse(viewGroup.isStartActionModeForChildTypelessCalled);
- }
-
- public void testFloatingActionModesAreBubbledUp() {
- SearchDialog.SearchBar searchBar = new SearchDialog.SearchBar(mContext);
- MockViewGroup viewGroup = new MockViewGroup(mContext);
- viewGroup.addView(searchBar);
-
- searchBar.startActionModeForChild(null, null, ActionMode.TYPE_FLOATING);
-
- // Should bubble up.
- assertTrue(viewGroup.isStartActionModeForChildTypedCalled);
- }
-
- private static class MockViewGroup extends ViewGroup {
- boolean isStartActionModeForChildTypedCalled = false;
- boolean isStartActionModeForChildTypelessCalled = false;
-
- public MockViewGroup(Context context) {
- super(context);
- }
-
- @Override
- public ActionMode startActionModeForChild(View originalView, ActionMode.Callback callback) {
- isStartActionModeForChildTypelessCalled = true;
- return super.startActionModeForChild(originalView, callback);
- }
-
- @Override
- public ActionMode startActionModeForChild(
- View originalView, ActionMode.Callback callback, int type) {
- isStartActionModeForChildTypedCalled = true;
- return super.startActionModeForChild(originalView, callback, type);
- }
-
- @Override
- protected void onLayout(boolean changed, int l, int t, int r, int b) {}
- }
-}