use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class TextureCompressionFormatParityValidatorTest method sameTCFsWithProperDefaultSuffix_ok.
@Test
public void sameTCFsWithProperDefaultSuffix_ok() throws Exception {
BundleModule moduleA = new BundleModuleBuilder("a").addFile("assets/textures#tcf_astc/level1.assets").addFile("assets/textures#tcf_etc2/level1.assets").setManifest(androidManifest("com.test.app")).build();
BundleModule moduleB = new BundleModuleBuilder("b").addFile("assets/other_textures#tcf_astc/astc_file.assets").addFile("assets/other_textures#tcf_etc2/etc2_file.assets").setManifest(androidManifest("com.test.app")).build();
AppBundle appBundle = new AppBundleBuilder().addModule(moduleA).addModule(moduleB).setBundleConfig(BundleConfigBuilder.create().addSplitDimension(Value.TEXTURE_COMPRESSION_FORMAT, /* negate= */
false, /* stripSuffix= */
false, /* defaultSuffix= */
"astc").build()).build();
new TextureCompressionFormatParityValidator().validateBundle(appBundle);
new TextureCompressionFormatParityValidator().validateAllModules(ImmutableList.of(moduleA, moduleB));
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class TextureCompressionFormatParityValidatorTest method sameTCFsIncludingFallbackAndNoTCF_ok.
@Test
public void sameTCFsIncludingFallbackAndNoTCF_ok() throws Exception {
BundleModule moduleA = new BundleModuleBuilder("a").addFile("assets/textures#tcf_astc/level1.assets").addFile("assets/textures#tcf_etc2/level1.assets").addFile("assets/textures/level1.assets").setManifest(androidManifest("com.test.app")).build();
BundleModule moduleB = new BundleModuleBuilder("b").addFile("assets/other_textures#tcf_astc/astc_file.assets").addFile("assets/other_textures#tcf_etc2/etc2_file.assets").addFile("assets/other_textures/fallback_file.assets").setManifest(androidManifest("com.test.app")).build();
BundleModule moduleC = new BundleModuleBuilder("c").addFile("assets/untargeted_textures/level3.assets").setManifest(androidManifest("com.test.app")).build();
AppBundle appBundle = new AppBundleBuilder().addModule(moduleA).addModule(moduleB).build();
new TextureCompressionFormatParityValidator().validateAllModules(ImmutableList.of(moduleA, moduleB, moduleC));
new TextureCompressionFormatParityValidator().validateBundle(appBundle);
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class TextureCompressionFormatParityValidatorTest method sameTCFsIncludingFallback_ok.
@Test
public void sameTCFsIncludingFallback_ok() throws Exception {
BundleModule moduleA = new BundleModuleBuilder("a").addFile("assets/textures#tcf_astc/level1.assets").addFile("assets/textures#tcf_etc2/level1.assets").addFile("assets/textures/level1.assets").setManifest(androidManifest("com.test.app")).build();
BundleModule moduleB = new BundleModuleBuilder("b").addFile("assets/other_textures#tcf_astc/astc_file.assets").addFile("assets/other_textures#tcf_etc2/etc2_file.assets").addFile("assets/other_textures/fallback_file.assets").setManifest(androidManifest("com.test.app")).build();
AppBundle appBundle = new AppBundleBuilder().addModule(moduleA).addModule(moduleB).build();
new TextureCompressionFormatParityValidator().validateBundle(appBundle);
new TextureCompressionFormatParityValidator().validateAllModules(ImmutableList.of(moduleA, moduleB));
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class BundleConfigValidatorTest method optimizations_defaultDeviceTier_targeted_unspecified_success.
@Test
public void optimizations_defaultDeviceTier_targeted_unspecified_success() throws Exception {
AppBundleBuilder appBundleBuilder = new AppBundleBuilder().addModule(new BundleModuleBuilder("base").setManifest(androidManifest("com.test.app")).build()).addModule(new BundleModuleBuilder("a").addFile("assets/textures#tier_1/level1.assets").addFile("assets/textures#tier_2/level1.assets").setManifest(androidManifest("com.test.app")).build());
new BundleConfigValidator().validateBundle(appBundleBuilder.build());
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class BundleConfigValidatorTest method optimizations_defaultDeviceTier_untargeted_unspecified.
@Test
public void optimizations_defaultDeviceTier_untargeted_unspecified() throws Exception {
AppBundleBuilder appBundleBuilder = new AppBundleBuilder().addModule(new BundleModuleBuilder("base").addFile("assets/textures#tcf_astc/level1.assets").addFile("assets/textures#tcf_astc/level1.assets").setManifest(androidManifest("com.test.app")).build());
new BundleConfigValidator().validateBundle(appBundleBuilder.build());
}
Aggregations