// Copyright (C) 2022 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

android_test {
    name: "AdServicesApkUISettingsTests",
    srcs: [
        "src/**/*.java",
        ":adservicesapk-filegroup",
    ],
    exclude_srcs: [
        "src/com/android/adservices/ui/settings/AppConsentSettingsUiAutomatorTest.java",
    ],
    certificate: "platform",
    privileged: true,
    defaults: ["modules-utils-testable-device-config-defaults"],
    sdk_version: "module_current",
    min_sdk_version: "Tiramisu",
    static_libs: [
        "compatibility-device-util-axt",
        "adservices-service-core",
        "adservices-assets",
        "adservices-test-utility",
        "adservices-ui-test-utility",
        "androidx.fragment_fragment",
        "androidx.test.espresso.contrib",
        "androidx.test.ext.junit",
        "androidx.test.rules",
        "mockito-target-extended-minus-junit4",
        "androidx.room_room-runtime",
        "androidx.room_room-testing",
        "truth",
        "SettingsLibActionBarShadow",
        "SettingsLibSettingsTheme",
        "SettingsLibCollapsingToolbarBaseActivity",
        "SettingsLibMainSwitchPreference",
        "androidx.test.uiautomator_uiautomator",
        "adservices-clients",
    ],
    libs: [
        "android.test.base.stubs.system",
        "android.test.mock.stubs",
        "framework-adservices.impl",
        "framework-annotations-lib",
    ],
    test_suites: [
        "general-tests",
        "mts-adservices",
    ],
    data: [":com.example.adservices.samples.ui.consenttestapp"],
    instrumentation_for: "AdServicesApk",
}

android_test {
    name: "AdExtServicesApkUISettingsTests",
    srcs: [
        "src/**/*.java",
        ":adservicesapk-filegroup",
    ],
    exclude_srcs: [
        "src/com/android/adservices/ui/settings/AppConsentSettingsUiAutomatorTest.java",
    ],
    certificate: "platform",
    privileged: true,
    defaults: ["modules-utils-testable-device-config-defaults"],
    sdk_version: "module_current",
    min_sdk_version: "31",
    max_sdk_version: "32",
    static_libs: [
        "compatibility-device-util-axt",
        "adservices-service-core",
        "adservices-assets",
        "adservices-test-utility",
        "adservices-ui-test-utility",
        "androidx.fragment_fragment",
        "androidx.test.espresso.contrib",
        "androidx.test.ext.junit",
        "androidx.test.rules",
        "mockito-target-extended-minus-junit4",
        "androidx.room_room-runtime",
        "androidx.room_room-testing",
        "truth",
        "SettingsLibActionBarShadow",
        "SettingsLibSettingsTheme",
        "SettingsLibCollapsingToolbarBaseActivity",
        "SettingsLibMainSwitchPreference",
        "androidx.test.uiautomator_uiautomator",
        "adservices-clients",
    ],
    libs: [
        "android.test.base.stubs.system",
        "android.test.mock.stubs",
        "android.ext.adservices",
        "framework-annotations-lib",
    ],
    test_suites: [
        "general-tests",
        "mts-extservices",
    ],
    test_config: "AndroidTest.ExtServices.xml",
    manifest: "AndroidManifestExtServices.xml",
    data: [":com.example.adservices.samples.ui.consenttestapp"],
    instrumentation_for: "ExtServices-sminus",
}

android_test {
    name: "AdServicesApkUITestsAppConsent",
    srcs: [
        "src/com/android/adservices/ui/settings/AppConsentSettingsUiAutomatorTest.java",
        ":adservicesapk-filegroup",
    ],
    certificate: "platform",
    privileged: true,
    defaults: ["modules-utils-testable-device-config-defaults"],
    sdk_version: "module_current",
    min_sdk_version: "Tiramisu",
    static_libs: [
        "compatibility-device-util-axt",
        "adservices-service-core",
        "adservices-assets",
        "adservices-test-utility",
        "adservices-ui-test-utility",
        "androidx.fragment_fragment",
        "androidx.test.espresso.contrib",
        "androidx.test.ext.junit",
        "androidx.test.rules",
        "mockito-target-extended-minus-junit4",
        "androidx.room_room-runtime",
        "androidx.room_room-testing",
        "truth",
        "SettingsLibActionBarShadow",
        "SettingsLibSettingsTheme",
        "SettingsLibCollapsingToolbarBaseActivity",
        "SettingsLibMainSwitchPreference",
        "androidx.test.uiautomator_uiautomator",
    ],
    libs: [
        "android.test.base.stubs.system",
        "android.test.mock.stubs",
        "framework-adservices.impl",
        "framework-annotations-lib",
    ],
    test_suites: [
        "general-tests",
        "mts-adservices",
    ],
    test_config: "AndroidTest.AppConsent.xml",
    data: [":com.example.adservices.samples.ui.consenttestapp"],
    instrumentation_for: "AdServicesApk",
}

android_test {
    name: "AdExtServicesApkUITestsAppConsent",
    srcs: [
        "src/com/android/adservices/ui/settings/AppConsentSettingsUiAutomatorTest.java",
        ":adservicesapk-filegroup",
    ],
    certificate: "platform",
    privileged: true,
    defaults: ["modules-utils-testable-device-config-defaults"],
    max_sdk_version: "32",
    min_sdk_version: "31",
    static_libs: [
        "adservices-assets",
        "adservices-service-core",
        "adservices-test-utility",
        "adservices-ui-test-utility",
        "androidx.fragment_fragment",
        "androidx.room_room-runtime",
        "androidx.room_room-testing",
        "androidx.test.espresso.contrib",
        "androidx.test.ext.junit",
        "androidx.test.rules",
        "androidx.test.uiautomator_uiautomator",
        "compatibility-device-util-axt",
        "mockito-target-extended-minus-junit4",
        "truth",
        "SettingsLibActionBarShadow",
        "SettingsLibCollapsingToolbarBaseActivity",
        "SettingsLibMainSwitchPreference",
        "SettingsLibSettingsTheme",
    ],
    libs: [
        "android.ext.adservices",
        "android.test.base.stubs.system",
        "android.test.mock.stubs",
        "framework-annotations-lib",
    ],
    test_suites: [
        "general-tests",
        "mts-extservices",
    ],
    test_config: "AndroidTest.AppConsent.ExtServices.xml",
    data: [":com.example.adservices.samples.ui.consenttestapp"],
    instrumentation_for: "ExtServices-sminus",
    manifest: "AndroidManifestExtServices.xml",
}
