Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 1 | // This looks a bit awkward, but we need our tests to run against either |
| 2 | // MediaProvider or MediaProviderGoogle, and we don't know which one is |
| 3 | // on the device being tested, so we can't sign our tests with a key that |
| 4 | // will allow instrumentation. Thus we pull all the sources we need to |
| 5 | // run tests against into the test itself. |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 6 | android_test { |
| 7 | name: "MediaProviderTests", |
Jeff Sharkey | 113f34d | 2019-12-08 15:27:56 -0700 | [diff] [blame] | 8 | test_suites: [ |
| 9 | "device-tests", |
Kimberly Kreider | 61f0599 | 2020-12-15 16:19:16 -0800 | [diff] [blame^] | 10 | "mts-mediaprovider", |
Jeff Sharkey | 113f34d | 2019-12-08 15:27:56 -0700 | [diff] [blame] | 11 | ], |
Jeff Sharkey | d571f8c | 2020-04-08 21:37:38 -0600 | [diff] [blame] | 12 | compile_multilib: "both", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 13 | |
| 14 | manifest: "AndroidManifest.xml", |
| 15 | |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 16 | resource_dirs: [ |
| 17 | "main_res", |
| 18 | "res", |
| 19 | ], |
Abhijeet Kaur | 81c83b1 | 2020-12-04 15:30:53 +0000 | [diff] [blame] | 20 | |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 21 | srcs: [ |
Anton Hansson | 65958d0 | 2020-03-31 21:05:53 +0100 | [diff] [blame] | 22 | ":framework-mediaprovider-sources", |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 23 | ":mediaprovider-sources", |
Abhijeet Kaur | 81c83b1 | 2020-12-04 15:30:53 +0000 | [diff] [blame] | 24 | ":mediaprovider-testutils", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 25 | "src/**/*.java", |
| 26 | ], |
| 27 | |
| 28 | libs: [ |
| 29 | "android.test.base", |
| 30 | "android.test.mock", |
| 31 | "android.test.runner", |
Artur Satayev | 2bb438d | 2020-01-23 15:26:14 +0000 | [diff] [blame] | 32 | "unsupportedappusage", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 33 | ], |
| 34 | |
| 35 | static_libs: [ |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 36 | "androidx.appcompat_appcompat", |
| 37 | "androidx.core_core", |
Brett Chabot | c3a0f78 | 2018-12-13 19:06:19 -0800 | [diff] [blame] | 38 | "androidx.test.rules", |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 39 | "guava", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 40 | "mockito-target", |
Jeff Sharkey | 0fac941 | 2020-04-01 22:59:39 -0600 | [diff] [blame] | 41 | "truth-prebuilt", |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 42 | ], |
| 43 | |
| 44 | certificate: "media", |
| 45 | |
Jeff Sharkey | c55994b | 2019-12-20 19:43:59 -0700 | [diff] [blame] | 46 | aaptflags: ["--custom-package com.android.providers.media"], |
Jeff Sharkey | b3e6603 | 2020-05-03 11:34:41 -0600 | [diff] [blame] | 47 | |
| 48 | errorprone: { |
| 49 | javacflags: [ |
| 50 | "-Xep:CatchFail:ERROR", |
| 51 | "-Xep:MissingFail:ERROR", |
| 52 | ], |
| 53 | }, |
felkachang | 775842b | 2018-10-16 17:05:44 +0800 | [diff] [blame] | 54 | } |
Abhijeet Kaur | 81c83b1 | 2020-12-04 15:30:53 +0000 | [diff] [blame] | 55 | |
| 56 | filegroup { |
| 57 | name: "mediaprovider-testutils", |
| 58 | srcs: ["utils/**/*.java"], |
| 59 | } |