summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfelkachang <felkachang@google.com>2018-10-17 14:31:38 +0800
committerFelka Chang <felkachang@google.com>2018-11-14 02:23:16 +0000
commit5f1ea5263ff0cf21e4f531253c49c23efed1ba76 (patch)
tree2f93fd2d0784b96754c9b67386189bae9b3d7ac3 /tests
parent52c2ef8358b281e7e03f20663eab7af451cd6d7e (diff)
downloadandroid_packages_providers_DownloadProvider-5f1ea5263ff0cf21e4f531253c49c23efed1ba76.tar.gz
android_packages_providers_DownloadProvider-5f1ea5263ff0cf21e4f531253c49c23efed1ba76.tar.bz2
android_packages_providers_DownloadProvider-5f1ea5263ff0cf21e4f531253c49c23efed1ba76.zip
Convert android.mk to android.bp
In order to o speedup the development cycle, transform android.mk to android.bp * add license * add AndroidTest.xml Change-Id: I970a37e967d41abd38951cc8a5598eb1e0b27c3d Fixes: 117861161 Test: atest DownloadProviderTests DownloadPublicApiAccessTests \ DownloadProviderPermissionTests
Diffstat (limited to 'tests')
-rw-r--r--tests/Android.bp41
-rw-r--r--tests/Android.mk22
-rw-r--r--tests/permission/Android.bp34
-rw-r--r--tests/permission/Android.mk16
-rw-r--r--tests/permission/AndroidTest.xml28
-rw-r--r--tests/public_api_access/Android.bp33
-rw-r--r--tests/public_api_access/Android.mk16
-rw-r--r--tests/public_api_access/AndroidTest.xml28
8 files changed, 164 insertions, 54 deletions
diff --git a/tests/Android.bp b/tests/Android.bp
new file mode 100644
index 00000000..3c03c82d
--- /dev/null
+++ b/tests/Android.bp
@@ -0,0 +1,41 @@
+// 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.
+//
+
+android_test {
+ name: "DownloadProviderTests",
+
+ srcs: [
+ "src/**/*.java",
+ ],
+
+ libs: [
+ "android.test.base",
+ "android.test.mock",
+ "android.test.runner",
+ ],
+
+ static_libs: [
+ "mockito-target",
+ "mockwebserver",
+ ],
+
+ platform_apis: true,
+
+ instrumentation_for: "DownloadProvider",
+
+ test_suites: ["device-tests"],
+
+ certificate: "media",
+}
diff --git a/tests/Android.mk b/tests/Android.mk
deleted file mode 100644
index c3d9bcb7..00000000
--- a/tests/Android.mk
+++ /dev/null
@@ -1,22 +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_INSTRUMENTATION_FOR := DownloadProvider
-LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base android.test.mock
-LOCAL_STATIC_JAVA_LIBRARIES := \
- mockwebserver \
- mockito-target
-LOCAL_PACKAGE_NAME := DownloadProviderTests
-LOCAL_PRIVATE_PLATFORM_APIS := true
-LOCAL_COMPATIBILITY_SUITE := device-tests
-LOCAL_CERTIFICATE := media
-
-include $(BUILD_PACKAGE)
-
-# additionally, build sub-tests in a separate .apk
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/permission/Android.bp b/tests/permission/Android.bp
new file mode 100644
index 00000000..c3767e16
--- /dev/null
+++ b/tests/permission/Android.bp
@@ -0,0 +1,34 @@
+// 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.
+//
+
+android_test {
+ name: "DownloadProviderPermissionTests",
+
+ srcs: [
+ "src/**/*.java",
+ ],
+
+ libs: [
+ "android.test.base",
+ "android.test.runner",
+ ],
+
+ static_libs: [
+ "junit",
+ ],
+
+ platform_apis: true,
+
+}
diff --git a/tests/permission/Android.mk b/tests/permission/Android.mk
deleted file mode 100644
index ae96b5cd..00000000
--- a/tests/permission/Android.mk
+++ /dev/null
@@ -1,16 +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_JAVA_LIBRARIES := android.test.runner android.test.base
-LOCAL_STATIC_JAVA_LIBRARIES := junit
-LOCAL_PACKAGE_NAME := DownloadProviderPermissionTests
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_PACKAGE)
-
diff --git a/tests/permission/AndroidTest.xml b/tests/permission/AndroidTest.xml
new file mode 100644
index 00000000..e6375ab3
--- /dev/null
+++ b/tests/permission/AndroidTest.xml
@@ -0,0 +1,28 @@
+<?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="Run tests for download provider permission.">
+ <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
+ <option name="test-file-name" value="DownloadProviderPermissionTests.apk" />
+ </target_preparer>
+
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-tag" value="DownloadProviderPermissionTests" />
+ <test class="com.android.tradefed.testtype.InstrumentationTest" >
+ <option name="package" value="com.android.providers.downloads.permission.tests" />
+ <option name="runner" value="android.test.InstrumentationTestRunner" />
+ <option name="hidden-api-checks" value="false"/>
+ </test>
+</configuration>
diff --git a/tests/public_api_access/Android.bp b/tests/public_api_access/Android.bp
new file mode 100644
index 00000000..0845bfa9
--- /dev/null
+++ b/tests/public_api_access/Android.bp
@@ -0,0 +1,33 @@
+// 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.
+//
+
+android_test {
+ name: "DownloadPublicApiAccessTests",
+
+ srcs: [
+ "src/**/*.java",
+ ],
+
+ libs: [
+ "android.test.base",
+ "android.test.runner",
+ ],
+
+ static_libs: [
+ "junit",
+ ],
+
+ platform_apis: true,
+}
diff --git a/tests/public_api_access/Android.mk b/tests/public_api_access/Android.mk
deleted file mode 100644
index 3bc2e8e8..00000000
--- a/tests/public_api_access/Android.mk
+++ /dev/null
@@ -1,16 +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_JAVA_LIBRARIES := android.test.runner android.test.base
-LOCAL_STATIC_JAVA_LIBRARIES := junit
-LOCAL_PACKAGE_NAME := DownloadPublicApiAccessTests
-LOCAL_PRIVATE_PLATFORM_APIS := true
-
-include $(BUILD_PACKAGE)
-
diff --git a/tests/public_api_access/AndroidTest.xml b/tests/public_api_access/AndroidTest.xml
new file mode 100644
index 00000000..abd1dec9
--- /dev/null
+++ b/tests/public_api_access/AndroidTest.xml
@@ -0,0 +1,28 @@
+<?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="Run tests for download public API.">
+ <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
+ <option name="test-file-name" value="DownloadPublicApiAccessTests.apk" />
+ </target_preparer>
+
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-tag" value="DownloadPublicApiAccessTests" />
+ <test class="com.android.tradefed.testtype.InstrumentationTest" >
+ <option name="package" value="com.android.providers.downloads.public_api_access_tests" />
+ <option name="runner" value="android.test.InstrumentationTestRunner" />
+ <option name="hidden-api-checks" value="false"/>
+ </test>
+</configuration>