• 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
19android_test_helper_app {
20    name: "BUG-237291548",
21    defaults: ["cts_support_defaults"],
22    srcs: ["src/**/*.java"],
23    test_suites: [
24        "cts",
25        "vts10",
26        "sts",
27    ],
28    static_libs: [
29        "androidx.appcompat_appcompat",
30        "androidx.test.rules",
31        "androidx.test.uiautomator_uiautomator",
32        "androidx.test.core",
33    ],
34    sdk_version: "current",
35}
36
37android_test_helper_app {
38    name: "BUG-237291548-FAIL-INSTALL",
39    defaults: ["cts_support_defaults"],
40    srcs: ["src/**/*.java"],
41    manifest: ":BUG-237291548-BAD-MANIFEST",
42    test_suites: [
43        "cts",
44        "vts10",
45        "sts",
46    ],
47    static_libs: [
48        "androidx.appcompat_appcompat",
49        "androidx.test.rules",
50        "androidx.test.uiautomator_uiautomator",
51        "androidx.test.core",
52    ],
53    sdk_version: "current",
54}
55
56// Modify the manifest file to include more than 500 MIME groups. The resulting
57// test apk generated using this manifest should fail package install since the
58// number of MIME groups is limited to a maximum of 500 per package.
59genrule {
60    name: "BUG-237291548-BAD-MANIFEST",
61    srcs: ["AndroidManifest.xml"],
62    out: ["BadAndroidManifest.xml"],
63    cmd: "awk '/myMimeGroup/{print;for(i=0;i<501;i++){sub(/myMimeGroup[0-9]*/,\"myMimeGroup\"i);print}}1' $(in) > $(out)",
64}