• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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// Robolectric test target for testing mdd test lib classes #
21//###########################################################
22android_app {
23    name: "MobileDataDownloadPlaceHolderApp",
24    manifest: "com/google/android/libraries/mobiledatadownload/internal/AndroidManifest.xml",
25    platform_apis: true,
26    libs: [
27        "android.test.runner.stubs.system",
28    ],
29}
30
31android_robolectric_test {
32
33    name: "MobileDataDownloadRoboTests",
34
35    srcs: [
36        "com/google/android/libraries/mobiledatadownload/internal/*.java",
37    ],
38
39    exclude_srcs: [
40        // Already compiled from mdd-robolectric-library
41        "com/google/android/libraries/mobiledatadownload/internal/MddTestUtil.java",
42        // Tests that are not yet ready to be included.
43        // TODO: (b/256877824) To be removed once the dependency for LabsFutures and ProtoParsers is resolved.
44        "com/google/android/libraries/mobiledatadownload/internal/MobileDataDownloadManagerTest.java", // Missing LabsFutures
45        "com/google/android/libraries/mobiledatadownload/internal/FileGroupManagerTest.java", // Missing LabsFutures
46        "com/google/android/libraries/mobiledatadownload/internal/util/ProtoConversionUtilTest.java", // Missing ProtoParsers
47        "com/google/android/libraries/mobiledatadownload/internal/MddIsolatedStructuresTest.java", //android.os.symlink and android.os.readlink do not work with robolectric
48        "com/google/android/libraries/mobiledatadownload/testing/FakeMobileDataDownload.java", // Missing GoogleLogger
49        "com/google/android/libraries/mobiledatadownload/testing/MddTestDependencies.java", // Missing BaseFileDownloaderModule
50        "com/google/android/libraries/mobiledatadownload/internal/ExpirationHandlerTest.java", // Test failed
51
52    ],
53
54    java_resource_dirs: ["config"],
55
56    libs: [
57        // This jar should not be included, android_robolectric_test soong tasks either ads
58        // "Robolectric_all-target" or "Robolectric_all-target" based on the "upstream"
59        // flag below.
60        "androidx.test.core",
61        "mobile_data_downloader_lib",
62        "mdd-robolectric-library",
63    ],
64
65    // use external/robolectric, rather than the outdated external/robolectric-shadows.
66
67    instrumentation_for: "MobileDataDownloadPlaceHolderApp",
68
69    strict_mode: false,
70
71}
72