Fix app tests to work without javaMockFS()

Bug: 182638834
Test: m nothing
Change-Id: Ia1815557e6d9dba1cb24f824a988c7599263bf85
This commit is contained in:
Paul Duffin
2021-03-13 02:36:00 +00:00
parent cdb88a996a
commit 2645a2912f

View File

@@ -375,6 +375,9 @@ func TestUpdatableApps(t *testing.T) {
errorHandler = android.FixtureExpectsAtLeastOneErrorMatchingPattern(test.expectedError) errorHandler = android.FixtureExpectsAtLeastOneErrorMatchingPattern(test.expectedError)
} }
javaFixtureFactory. javaFixtureFactory.
Extend(FixtureWithPrebuiltApis(map[string][]string{
"29": {"foo"},
})).
ExtendWithErrorHandler(errorHandler).RunTestWithBp(t, test.bp) ExtendWithErrorHandler(errorHandler).RunTestWithBp(t, test.bp)
}) })
} }
@@ -1081,6 +1084,9 @@ func TestAppSdkVersion(t *testing.T) {
variables.Platform_version_active_codenames = test.activeCodenames variables.Platform_version_active_codenames = test.activeCodenames
variables.Platform_sdk_final = &test.platformSdkFinal variables.Platform_sdk_final = &test.platformSdkFinal
}), }),
FixtureWithPrebuiltApis(map[string][]string{
"14": {"foo"},
}),
).RunTestWithBp(t, bp) ).RunTestWithBp(t, bp)
checkSdkVersion(t, result, test.expectedMinSdkVersion) checkSdkVersion(t, result, test.expectedMinSdkVersion)
@@ -1147,6 +1153,11 @@ func TestVendorAppSdkVersion(t *testing.T) {
variables.DeviceCurrentApiLevelForVendorModules = &test.deviceCurrentApiLevelForVendorModules variables.DeviceCurrentApiLevelForVendorModules = &test.deviceCurrentApiLevelForVendorModules
variables.DeviceSystemSdkVersions = []string{"28", "29"} variables.DeviceSystemSdkVersions = []string{"28", "29"}
}), }),
FixtureWithPrebuiltApis(map[string][]string{
"28": {"foo"},
"29": {"foo"},
"current": {"foo"},
}),
).RunTestWithBp(t, bp) ).RunTestWithBp(t, bp)
checkSdkVersion(t, result, test.expectedMinSdkVersion) checkSdkVersion(t, result, test.expectedMinSdkVersion)
@@ -2359,6 +2370,8 @@ func TestUsesLibraries(t *testing.T) {
` `
result := javaFixtureFactory.Extend( result := javaFixtureFactory.Extend(
PrepareForTestWithJavaSdkLibraryFiles,
FixtureWithLastReleaseApis("runtime-library", "foo", "quuz", "qux", "bar", "fred"),
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.MissingUsesLibraries = []string{"baz"} variables.MissingUsesLibraries = []string{"baz"}
}), }),
@@ -2706,6 +2719,7 @@ func TestUncompressDex(t *testing.T) {
t.Helper() t.Helper()
result := javaFixtureFactory.Extend( result := javaFixtureFactory.Extend(
PrepareForTestWithPrebuiltsOfCurrentApi,
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
if unbundled { if unbundled {
variables.Unbundled_build = proptools.BoolPtr(true) variables.Unbundled_build = proptools.BoolPtr(true)