diff options
| author | 2024-12-03 22:05:29 +0000 | |
|---|---|---|
| committer | 2024-12-03 22:05:29 +0000 | |
| commit | 53cee9d417f1912cb7370f3eb1a25d1ce7e76cbf (patch) | |
| tree | 024a17c422b55b5e7aac647c6676a7201f77148f /java/app_test.go | |
| parent | 820ab8b5f36d60747e60322d105ccb1e6998861c (diff) | |
| parent | e8ef6f1540ca7518e2e2998779b5f2d37b7a1479 (diff) | |
Merge "Revert "Use soong built autogenerated RROs"" into main
Diffstat (limited to 'java/app_test.go')
| -rw-r--r-- | java/app_test.go | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/java/app_test.go b/java/app_test.go index 61b718d00..3d83ea1dc 100644 --- a/java/app_test.go +++ b/java/app_test.go @@ -4727,74 +4727,3 @@ func TestResourcesWithFlagDirectories(t *testing.T) { "out/soong/.intermediates/foo/android_common/aapt2/res/values_strings.(test.package.flag1).arsc.flat", ) } - -func TestAutogeneratedStaticRro(t *testing.T) { - t.Parallel() - bp := ` -android_app { - name: "foo", - srcs: ["foo.java"], - platform_apis: true, -} -override_android_app { - name: "override_foo", - base: "foo", -} -` - testCases := []struct { - desc string - preparer android.FixturePreparer - overlayApkExpected bool - }{ - { - desc: "No DEVICE_PACKAGE_OVERLAYS, no overlay .apk file", - overlayApkExpected: false, - }, - { - desc: "DEVICE_PACKAGE_OVERLAYS exists, but the directory is empty", - overlayApkExpected: false, - preparer: android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { - variables.DeviceResourceOverlays = []string{"device/company/test_product"} - }), - }, - { - desc: "DEVICE_PACKAGE_OVERLAYS exists, directory is non-empty, but does not contain a matching resource dir", - overlayApkExpected: false, - preparer: android.GroupFixturePreparers( - android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { - variables.DeviceResourceOverlays = []string{"device/company/test_product"} - }), - android.MockFS{ - "res/foo.xml": nil, - "device/company/test_product/different_res/foo.xml": nil, // different dir - }.AddToFixture(), - ), - }, - { - desc: "DEVICE_PACKAGE_OVERLAYS and the directory contain a matching resource dir", - overlayApkExpected: true, - preparer: android.GroupFixturePreparers( - android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { - variables.DeviceResourceOverlays = []string{"device/company/test_product"} - }), - android.MockFS{ - "res/foo.xml": nil, - "device/company/test_product/res/foo.xml": nil, - }.AddToFixture(), - ), - }, - } - for _, tc := range testCases { - result := android.GroupFixturePreparers( - PrepareForTestWithJavaDefaultModules, - android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { - variables.EnforceRROTargets = []string{"*"} - }), - android.OptionalFixturePreparer(tc.preparer), - ).RunTestWithBp(t, bp) - vendorOverlayApk := result.ModuleForTests("foo__test_product__auto_generated_rro_vendor", "android_arm64_armv8-a").MaybeOutput("foo__test_product__auto_generated_rro_vendor.apk") - android.AssertBoolEquals(t, tc.desc, tc.overlayApkExpected, vendorOverlayApk.Rule != nil) - overrideVendorOverlayApk := result.ModuleForTests("override_foo__test_product__auto_generated_rro_vendor", "android_arm64_armv8-a").MaybeOutput("override_foo__test_product__auto_generated_rro_vendor.apk") - android.AssertBoolEquals(t, tc.desc, tc.overlayApkExpected, overrideVendorOverlayApk.Rule != nil) - } -} |