] | a023ea2 | 2021-02-08 13:23:19 +0000 | [diff] [blame] | 1 | android_test_helper_app { |
Ivan Chiang | 5626be2 | 2021-06-25 13:36:13 +0800 | [diff] [blame] | 2 | 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 | |
| 20 | android_test_helper_app { |
] | a023ea2 | 2021-02-08 13:23:19 +0000 | [diff] [blame] | 21 | 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", |
Corina | 20af4bc | 2021-04-28 20:46:00 +0000 | [diff] [blame] | 31 | target_sdk_version: "30", |
Corina | 97dbb24 | 2021-03-09 14:28:56 +0000 | [diff] [blame] | 32 | min_sdk_version: "30", |
] | a023ea2 | 2021-02-08 13:23:19 +0000 | [diff] [blame] | 33 | test_suites: [ |
| 34 | "device-tests", |
| 35 | "mts-mediaprovider", |
| 36 | ], |
| 37 | } |
| 38 | |
| 39 | android_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", |
Corina | 20af4bc | 2021-04-28 20:46:00 +0000 | [diff] [blame] | 50 | target_sdk_version: "30", |
Corina | 97dbb24 | 2021-03-09 14:28:56 +0000 | [diff] [blame] | 51 | min_sdk_version: "30", |
] | a023ea2 | 2021-02-08 13:23:19 +0000 | [diff] [blame] | 52 | test_suites: [ |
| 53 | "device-tests", |
| 54 | "mts-mediaprovider", |
| 55 | ], |
| 56 | } |
| 57 | |
| 58 | android_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", |
Corina | 97dbb24 | 2021-03-09 14:28:56 +0000 | [diff] [blame] | 70 | min_sdk_version: "30", |
] | a023ea2 | 2021-02-08 13:23:19 +0000 | [diff] [blame] | 71 | test_suites: [ |
| 72 | "device-tests", |
| 73 | "mts-mediaprovider", |
| 74 | ], |
| 75 | } |
| 76 | |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 77 | // 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 Badour | 45b6e7d | 2021-02-12 18:09:33 -0800 | [diff] [blame] | 82 | package { |
| 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 | |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 91 | android_test { |
| 92 | name: "MediaProviderTests", |
Jeff Sharkey | 113f34d | 2019-12-08 15:27:56 -0700 | [diff] [blame] | 93 | test_suites: [ |
| 94 | "device-tests", |
Kimberly Kreider | 61f0599 | 2020-12-15 16:19:16 -0800 | [diff] [blame] | 95 | "mts-mediaprovider", |
Jeff Sharkey | 113f34d | 2019-12-08 15:27:56 -0700 | [diff] [blame] | 96 | ], |
Jeff Sharkey | d571f8c | 2020-04-08 21:37:38 -0600 | [diff] [blame] | 97 | compile_multilib: "both", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 98 | |
| 99 | manifest: "AndroidManifest.xml", |
| 100 | |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 101 | resource_dirs: [ |
| 102 | "main_res", |
| 103 | "res", |
| 104 | ], |
Abhijeet Kaur | 81c83b1 | 2020-12-04 15:30:53 +0000 | [diff] [blame] | 105 | |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 106 | srcs: [ |
Anton Hansson | 65958d0 | 2020-03-31 21:05:53 +0100 | [diff] [blame] | 107 | ":framework-mediaprovider-sources", |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 108 | ":mediaprovider-sources", |
Abhijeet Kaur | 81c83b1 | 2020-12-04 15:30:53 +0000 | [diff] [blame] | 109 | ":mediaprovider-testutils", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 110 | "src/**/*.java", |
| 111 | ], |
| 112 | |
| 113 | libs: [ |
| 114 | "android.test.base", |
| 115 | "android.test.mock", |
| 116 | "android.test.runner", |
Artur Satayev | 2bb438d | 2020-01-23 15:26:14 +0000 | [diff] [blame] | 117 | "unsupportedappusage", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 118 | ], |
| 119 | |
| 120 | static_libs: [ |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 121 | "androidx.appcompat_appcompat", |
| 122 | "androidx.core_core", |
Brett Chabot | c3a0f78 | 2018-12-13 19:06:19 -0800 | [diff] [blame] | 123 | "androidx.test.rules", |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 124 | "guava", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 125 | "mockito-target", |
Ivan Chiang | 7fce4a5 | 2021-01-25 16:53:54 +0800 | [diff] [blame] | 126 | "modules-utils-build", |
Jeff Sharkey | 0fac941 | 2020-04-01 22:59:39 -0600 | [diff] [blame] | 127 | "truth-prebuilt", |
] | a023ea2 | 2021-02-08 13:23:19 +0000 | [diff] [blame] | 128 | "cts-install-lib", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 129 | ], |
| 130 | |
| 131 | certificate: "media", |
| 132 | |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 133 | aaptflags: ["--custom-package com.android.providers.media"], |
Jeff Sharkey | b3e6603 | 2020-05-03 11:34:41 -0600 | [diff] [blame] | 134 | |
| 135 | errorprone: { |
| 136 | javacflags: [ |
| 137 | "-Xep:CatchFail:ERROR", |
| 138 | "-Xep:MissingFail:ERROR", |
| 139 | ], |
| 140 | }, |
] | a023ea2 | 2021-02-08 13:23:19 +0000 | [diff] [blame] | 141 | |
| 142 | java_resources: [ |
| 143 | ":MediaProviderTestAppWithStoragePerms", |
| 144 | ":MediaProviderTestAppWithoutPerms", |
Ivan Chiang | 5626be2 | 2021-06-25 13:36:13 +0800 | [diff] [blame] | 145 | ":MediaProviderTestAppForPermissionActivity", |
] | a023ea2 | 2021-02-08 13:23:19 +0000 | [diff] [blame] | 146 | ":LegacyMediaProviderTestApp", |
| 147 | ], |
Corina | 97dbb24 | 2021-03-09 14:28:56 +0000 | [diff] [blame] | 148 | |
| 149 | min_sdk_version: "30", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 150 | } |
Abhijeet Kaur | 81c83b1 | 2020-12-04 15:30:53 +0000 | [diff] [blame] | 151 | |
| 152 | filegroup { |
| 153 | name: "mediaprovider-testutils", |
| 154 | srcs: ["utils/**/*.java"], |
| 155 | } |