2021-08-16 12:02:39 -07:00
|
|
|
// Copyright (C) 2021 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"],
|
|
|
|
}
|
|
|
|
|
2021-09-02 14:59:48 -07:00
|
|
|
java_defaults {
|
|
|
|
name: "ComponentAliasTests_defaults",
|
2021-08-16 12:02:39 -07:00
|
|
|
static_libs: [
|
|
|
|
"androidx.test.rules",
|
|
|
|
"compatibility-device-util-axt",
|
|
|
|
"mockito-target-extended-minus-junit4",
|
|
|
|
"truth-prebuilt",
|
|
|
|
"ub-uiautomator",
|
|
|
|
],
|
|
|
|
libs: ["android.test.base"],
|
|
|
|
srcs: [
|
|
|
|
"src/**/*.java",
|
|
|
|
],
|
|
|
|
test_suites: [
|
|
|
|
"general-tests",
|
|
|
|
],
|
|
|
|
platform_apis: true, // We use hidden APIs in the test.
|
|
|
|
}
|
2021-09-02 14:59:48 -07:00
|
|
|
|
|
|
|
// We build three APKs from the exact same source files, so these APKs contain the exact same tests.
|
|
|
|
// And we run the tests on each APK, so that we can test various situations:
|
|
|
|
// - When the alias is in the same package, target in the same package.
|
|
|
|
// - When the alias is in the same package, target in another package.
|
|
|
|
// - When the alias is in another package, which also contains the target.
|
|
|
|
// - When the alias is in another package, and the target is in yet another package.
|
|
|
|
// etc etc...
|
|
|
|
|
|
|
|
android_test {
|
|
|
|
name: "ComponentAliasTests",
|
|
|
|
defaults: [
|
|
|
|
"ComponentAliasTests_defaults",
|
|
|
|
],
|
|
|
|
package_name: "android.content.componentalias.tests",
|
|
|
|
manifest: "AndroidManifest.xml",
|
|
|
|
additional_manifests: [
|
2021-09-16 16:07:54 -07:00
|
|
|
"AndroidManifest_main.xml",
|
2021-09-02 14:59:48 -07:00
|
|
|
"AndroidManifest_service_aliases.xml",
|
|
|
|
"AndroidManifest_service_targets.xml",
|
|
|
|
],
|
|
|
|
test_config_template: "AndroidTest-template.xml",
|
|
|
|
}
|
|
|
|
|
|
|
|
android_test {
|
|
|
|
name: "ComponentAliasTests1",
|
|
|
|
defaults: [
|
|
|
|
"ComponentAliasTests_defaults",
|
|
|
|
],
|
|
|
|
package_name: "android.content.componentalias.tests.sub1",
|
|
|
|
manifest: "AndroidManifest.xml",
|
|
|
|
additional_manifests: [
|
2021-09-16 16:07:54 -07:00
|
|
|
"AndroidManifest_sub1.xml",
|
2021-09-02 14:59:48 -07:00
|
|
|
"AndroidManifest_service_targets.xml",
|
|
|
|
],
|
|
|
|
test_config_template: "AndroidTest-template.xml",
|
|
|
|
}
|
|
|
|
|
|
|
|
android_test {
|
|
|
|
name: "ComponentAliasTests2",
|
|
|
|
defaults: [
|
|
|
|
"ComponentAliasTests_defaults",
|
|
|
|
],
|
|
|
|
package_name: "android.content.componentalias.tests.sub2",
|
|
|
|
manifest: "AndroidManifest.xml",
|
|
|
|
additional_manifests: [
|
2021-09-16 16:07:54 -07:00
|
|
|
"AndroidManifest_sub2.xml",
|
2021-09-02 14:59:48 -07:00
|
|
|
"AndroidManifest_service_targets.xml",
|
|
|
|
],
|
|
|
|
test_config_template: "AndroidTest-template.xml",
|
|
|
|
}
|