blob: 8a0503d7b0f25dfc88903dc46969e8df9c8e30e7 [file] [log] [blame]
]a023ea22021-02-08 13:23:19 +00001android_test_helper_app {
Ivan Chiang5626be22021-06-25 13:36:13 +08002 name: "MediaProviderTestAppForPermissionActivity",
3 manifest: "test_app/TestAppForPermissionActivity.xml",
4 srcs: [
5 "test_app/src/**/*.java",
6 "src/com/android/providers/media/util/TestUtils.java",
7 ],
8 static_libs: [
9 "cts-install-lib",
10 ],
11 sdk_version: "test_current",
12 target_sdk_version: "30",
13 min_sdk_version: "30",
14 test_suites: [
15 "device-tests",
16 "mts-mediaprovider",
17 ],
18}
19
20android_test_helper_app {
]a023ea22021-02-08 13:23:19 +000021 name: "MediaProviderTestAppWithStoragePerms",
22 manifest: "test_app/TestAppWithStoragePerms.xml",
23 srcs: [
24 "test_app/src/**/*.java",
25 "src/com/android/providers/media/util/TestUtils.java",
26 ],
27 static_libs: [
28 "cts-install-lib",
29 ],
30 sdk_version: "test_current",
Corina20af4bc2021-04-28 20:46:00 +000031 target_sdk_version: "30",
Corina97dbb242021-03-09 14:28:56 +000032 min_sdk_version: "30",
]a023ea22021-02-08 13:23:19 +000033 test_suites: [
34 "device-tests",
35 "mts-mediaprovider",
36 ],
37}
38
39android_test_helper_app {
40 name: "MediaProviderTestAppWithoutPerms",
41 manifest: "test_app/TestAppWithoutPerms.xml",
42 srcs: [
43 "test_app/src/**/*.java",
44 "src/com/android/providers/media/util/TestUtils.java",
45 ],
46 static_libs: [
47 "cts-install-lib",
48 ],
49 sdk_version: "test_current",
Corina20af4bc2021-04-28 20:46:00 +000050 target_sdk_version: "30",
Corina97dbb242021-03-09 14:28:56 +000051 min_sdk_version: "30",
]a023ea22021-02-08 13:23:19 +000052 test_suites: [
53 "device-tests",
54 "mts-mediaprovider",
55 ],
56}
57
58android_test_helper_app {
59 name: "LegacyMediaProviderTestApp",
60 manifest: "test_app/LegacyTestApp.xml",
61 srcs: [
62 "test_app/src/**/*.java",
63 "src/com/android/providers/media/util/TestUtils.java",
64 ],
65 static_libs: [
66 "cts-install-lib",
67 ],
68 sdk_version: "test_current",
69 target_sdk_version: "28",
Corina97dbb242021-03-09 14:28:56 +000070 min_sdk_version: "30",
]a023ea22021-02-08 13:23:19 +000071 test_suites: [
72 "device-tests",
73 "mts-mediaprovider",
74 ],
75}
76
Jeff Sharkeyc55994b2019-12-20 19:43:59 -070077// This looks a bit awkward, but we need our tests to run against either
78// MediaProvider or MediaProviderGoogle, and we don't know which one is
79// on the device being tested, so we can't sign our tests with a key that
80// will allow instrumentation. Thus we pull all the sources we need to
81// run tests against into the test itself.
Bob Badour45b6e7d2021-02-12 18:09:33 -080082package {
83 // See: http://go/android-license-faq
84 // A large-scale-change added 'default_applicable_licenses' to import
85 // all of the 'license_kinds' from "packages_providers_MediaProvider_license"
86 // to get the below license kinds:
87 // SPDX-license-identifier-Apache-2.0
88 default_applicable_licenses: ["packages_providers_MediaProvider_license"],
89}
90
felkachang775842b2018-10-16 17:05:44 +080091android_test {
92 name: "MediaProviderTests",
Jeff Sharkey113f34d2019-12-08 15:27:56 -070093 test_suites: [
94 "device-tests",
Kimberly Kreider61f05992020-12-15 16:19:16 -080095 "mts-mediaprovider",
Jeff Sharkey113f34d2019-12-08 15:27:56 -070096 ],
Jeff Sharkeyd571f8c2020-04-08 21:37:38 -060097 compile_multilib: "both",
felkachang775842b2018-10-16 17:05:44 +080098
99 manifest: "AndroidManifest.xml",
100
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700101 resource_dirs: [
102 "main_res",
103 "res",
104 ],
Abhijeet Kaur81c83b12020-12-04 15:30:53 +0000105
felkachang775842b2018-10-16 17:05:44 +0800106 srcs: [
Anton Hansson65958d02020-03-31 21:05:53 +0100107 ":framework-mediaprovider-sources",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700108 ":mediaprovider-sources",
Abhijeet Kaur81c83b12020-12-04 15:30:53 +0000109 ":mediaprovider-testutils",
felkachang775842b2018-10-16 17:05:44 +0800110 "src/**/*.java",
111 ],
112
113 libs: [
114 "android.test.base",
115 "android.test.mock",
116 "android.test.runner",
Artur Satayev2bb438d2020-01-23 15:26:14 +0000117 "unsupportedappusage",
felkachang775842b2018-10-16 17:05:44 +0800118 ],
119
120 static_libs: [
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700121 "androidx.appcompat_appcompat",
122 "androidx.core_core",
Brett Chabotc3a0f782018-12-13 19:06:19 -0800123 "androidx.test.rules",
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700124 "guava",
felkachang775842b2018-10-16 17:05:44 +0800125 "mockito-target",
Ivan Chiang7fce4a52021-01-25 16:53:54 +0800126 "modules-utils-build",
Jeff Sharkey0fac9412020-04-01 22:59:39 -0600127 "truth-prebuilt",
]a023ea22021-02-08 13:23:19 +0000128 "cts-install-lib",
felkachang775842b2018-10-16 17:05:44 +0800129 ],
130
131 certificate: "media",
132
Jeff Sharkeyc55994b2019-12-20 19:43:59 -0700133 aaptflags: ["--custom-package com.android.providers.media"],
Jeff Sharkeyb3e66032020-05-03 11:34:41 -0600134
135 errorprone: {
136 javacflags: [
137 "-Xep:CatchFail:ERROR",
138 "-Xep:MissingFail:ERROR",
139 ],
140 },
]a023ea22021-02-08 13:23:19 +0000141
142 java_resources: [
143 ":MediaProviderTestAppWithStoragePerms",
144 ":MediaProviderTestAppWithoutPerms",
Ivan Chiang5626be22021-06-25 13:36:13 +0800145 ":MediaProviderTestAppForPermissionActivity",
]a023ea22021-02-08 13:23:19 +0000146 ":LegacyMediaProviderTestApp",
147 ],
Corina97dbb242021-03-09 14:28:56 +0000148
149 min_sdk_version: "30",
felkachang775842b2018-10-16 17:05:44 +0800150}
Abhijeet Kaur81c83b12020-12-04 15:30:53 +0000151
152filegroup {
153 name: "mediaprovider-testutils",
154 srcs: ["utils/**/*.java"],
155}