diff options
| -rw-r--r-- | services/core/java/com/android/server/am/TEST_MAPPING | 22 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/TEST_MAPPING | 22 | ||||
| -rw-r--r-- | services/tests/wmtests/Android.mk | 41 | ||||
| -rw-r--r-- | services/tests/wmtests/AndroidManifest.xml | 31 | ||||
| -rw-r--r-- | services/tests/wmtests/AndroidTest.xml | 32 | ||||
| -rw-r--r-- | services/tests/wmtests/src/com/android/server/am/DummyAmTests.java | 46 | ||||
| -rw-r--r-- | services/tests/wmtests/src/com/android/server/wm/DummyWmTests.java | 46 |
7 files changed, 240 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/am/TEST_MAPPING b/services/core/java/com/android/server/am/TEST_MAPPING index 4ca96a1904db..b817669ce70c 100644 --- a/services/core/java/com/android/server/am/TEST_MAPPING +++ b/services/core/java/com/android/server/am/TEST_MAPPING @@ -49,6 +49,20 @@ "exclude-annotation": "androidx.test.filters.FlakyTest" } ] + }, + { + "name": "WmTests", + "options": [ + { + "include-filter": "com.android.server.am." + }, + { + "include-annotation": "android.platform.test.annotations.Presubmit" + }, + { + "exclude-annotation": "androidx.test.filters.FlakyTest" + } + ] } ], "postsubmit": [ @@ -65,6 +79,14 @@ "include-filter": "com.android.server.am." } ] + }, + { + "name": "WmTests", + "options": [ + { + "include-filter": "com.android.server.am." + } + ] } ] } diff --git a/services/core/java/com/android/server/wm/TEST_MAPPING b/services/core/java/com/android/server/wm/TEST_MAPPING index e885afa8031d..c99329a7508c 100644 --- a/services/core/java/com/android/server/wm/TEST_MAPPING +++ b/services/core/java/com/android/server/wm/TEST_MAPPING @@ -24,6 +24,20 @@ "exclude-annotation": "android.support.test.filters.FlakyTest" } ] + }, + { + "name": "WmTests", + "options": [ + { + "include-filter": "com.android.server.wm." + }, + { + "include-annotation": "android.platform.test.annotations.Presubmit" + }, + { + "exclude-annotation": "android.support.test.filters.FlakyTest" + } + ] } ], "postsubmit": [ @@ -37,6 +51,14 @@ "include-filter": "com.android.server.wm." } ] + }, + { + "name": "WmTests", + "options": [ + { + "include-filter": "com.android.server.wm." + } + ] } ] } diff --git a/services/tests/wmtests/Android.mk b/services/tests/wmtests/Android.mk new file mode 100644 index 000000000000..0f8b18ab92cf --- /dev/null +++ b/services/tests/wmtests/Android.mk @@ -0,0 +1,41 @@ +######################################################################### +# Build WmTests package +######################################################################### + +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) \ + $(call all-java-files-under, ../servicestests/utils) + +LOCAL_STATIC_JAVA_LIBRARIES := \ + androidx-test \ + mockito-target-minus-junit4 \ + platform-test-annotations \ + +LOCAL_JAVA_LIBRARIES := \ + android.test.mock \ + android.test.base \ + android.test.runner \ + +LOCAL_PACKAGE_NAME := WmTests +LOCAL_PRIVATE_PLATFORM_APIS := true +LOCAL_COMPATIBILITY_SUITE := device-tests + +LOCAL_CERTIFICATE := platform + +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk + +LOCAL_JACK_FLAGS := --multi-dex native +LOCAL_DX_FLAGS := --multi-dex + +LOCAL_PROGUARD_ENABLED := disabled + +include $(BUILD_PACKAGE) + +include $(call all-makefiles-under, $(LOCAL_PATH)) diff --git a/services/tests/wmtests/AndroidManifest.xml b/services/tests/wmtests/AndroidManifest.xml new file mode 100644 index 000000000000..1fb947309028 --- /dev/null +++ b/services/tests/wmtests/AndroidManifest.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2018 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" + package="com.android.frameworks.wmtests"> + + <!-- Uses API introduced in P (28) --> + <uses-sdk + android:minSdkVersion="1" + android:targetSdkVersion="28" /> + + <application android:testOnly="true" /> + + <instrumentation + android:name="androidx.test.runner.AndroidJUnitRunner" + android:label="Window Manager Tests" + android:targetPackage="com.android.frameworks.wmtests" /> +</manifest> diff --git a/services/tests/wmtests/AndroidTest.xml b/services/tests/wmtests/AndroidTest.xml new file mode 100644 index 000000000000..2717ef901216 --- /dev/null +++ b/services/tests/wmtests/AndroidTest.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2018 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. +--> + +<configuration description="Runs Window Manager Tests."> + <option name="test-suite-tag" value="apct" /> + <option name="test-suite-tag" value="apct-instrumentation" /> + <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> + <option name="cleanup-apks" value="true" /> + <option name="install-arg" value="-t" /> + <option name="test-file-name" value="WmTests.apk" /> + </target_preparer> + + <option name="test-tag" value="WmTests" /> + <test class="com.android.tradefed.testtype.AndroidJUnitTest"> + <option name="package" value="com.android.frameworks.wmtests" /> + <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" /> + <option name="hidden-api-checks" value="false" /> + </test> +</configuration> diff --git a/services/tests/wmtests/src/com/android/server/am/DummyAmTests.java b/services/tests/wmtests/src/com/android/server/am/DummyAmTests.java new file mode 100644 index 000000000000..023e4ab6636f --- /dev/null +++ b/services/tests/wmtests/src/com/android/server/am/DummyAmTests.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2018 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.server.am; + +import android.platform.test.annotations.Presubmit; + +import org.junit.Test; + +import androidx.test.filters.FlakyTest; + +/** + * Dummy test for com.android.server.am. + * TODO(b/113800711): Remove this class once the actual tests are moved from servicestests. + */ +public class DummyAmTests { + + @Presubmit + @Test + public void preSubmitTest() {} + + @FlakyTest + @Presubmit + @Test + public void flakyPreSubmitTest() {} + + @Test + public void postSubmitTest() {} + + @FlakyTest + @Test + public void flakyPostSubmitTest() {} +} diff --git a/services/tests/wmtests/src/com/android/server/wm/DummyWmTests.java b/services/tests/wmtests/src/com/android/server/wm/DummyWmTests.java new file mode 100644 index 000000000000..aecb2783badd --- /dev/null +++ b/services/tests/wmtests/src/com/android/server/wm/DummyWmTests.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2018 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.server.wm; + +import android.platform.test.annotations.Presubmit; + +import org.junit.Test; + +import androidx.test.filters.FlakyTest; + +/** + * Dummy test for com.android.server.wm + * TODO(b/113800711): Remove this class once the actual tests are moved from servicestests. + */ +public class DummyWmTests { + + @Presubmit + @Test + public void preSubmitTest() {} + + @FlakyTest + @Presubmit + @Test + public void flakyPreSubmitTest() {} + + @Test + public void postSubmitTest() {} + + @FlakyTest + @Test + public void flakyPostSubmitTest() {} +} |