1// Copyright (C) 2022 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 default_applicable_licenses: ["Android-Apache-2.0"], 17} 18 19 20//########################################################### 21// Robolectric test target for testing mdd test lib classes # 22//########################################################### 23android_app { 24 name: "MobileDataDownloadPlaceHolderApp", 25 manifest: "com/google/android/libraries/mobiledatadownload/internal/AndroidManifest.xml", 26 platform_apis: true, 27} 28 29android_robolectric_test { 30 31 name: "MobileDataDownloadRoboTests", 32 33 srcs: [ 34 "com/google/android/libraries/mobiledatadownload/internal/*.java", 35 ], 36 37 exclude_srcs: [ 38 // Already compiled from mdd-robolectric-library 39 "com/google/android/libraries/mobiledatadownload/internal/MddTestUtil.java", 40 // Tests that are not yet ready to be included. 41 // TODO: (b/256877824) To be removed once the dependency for LabsFutures and ProtoParsers is resolved. 42 "com/google/android/libraries/mobiledatadownload/internal/MobileDataDownloadManagerTest.java", // Missing LabsFutures 43 "com/google/android/libraries/mobiledatadownload/internal/FileGroupManagerTest.java", // Missing LabsFutures 44 "com/google/android/libraries/mobiledatadownload/internal/util/ProtoConversionUtilTest.java", // Missing ProtoParsers 45 "com/google/android/libraries/mobiledatadownload/internal/MddIsolatedStructuresTest.java", //android.os.symlink and android.os.readlink do not work with robolectric 46 "com/google/android/libraries/mobiledatadownload/testing/FakeMobileDataDownload.java", // Missing GoogleLogger 47 "com/google/android/libraries/mobiledatadownload/testing/MddTestDependencies.java", // Missing BaseFileDownloaderModule 48 "com/google/android/libraries/mobiledatadownload/internal/ExpirationHandlerTest.java" // Test failed 49 50 ], 51 52 java_resource_dirs: ["config"], 53 54 libs: [ 55 // This jar should not be included, android_robolectric_test soong tasks either ads 56 // "Robolectric_all-target" or "Robolectric_all-target_upstream" based on the "upstream" 57 // flag below. 58 "androidx.test.core", 59 "mobile_data_downloader_lib", 60 "mdd-robolectric-library", 61 ], 62 63 // use external/robolectric, rather than the outdated external/robolectric-shadows. 64 upstream: true, 65 66 instrumentation_for: "MobileDataDownloadPlaceHolderApp", 67 68} 69