use of com.android.bundle.Targeting.ApkTargeting in project bundletool by google.
the class MergingUtilsTest method mergeShardTargetings_equalLanguages_ok.
@Test
public void mergeShardTargetings_equalLanguages_ok() {
ApkTargeting targeting = apkLanguageTargeting("en");
assertThat(MergingUtils.mergeShardTargetings(targeting, targeting)).isEqualTo(apkLanguageTargeting("en"));
}
use of com.android.bundle.Targeting.ApkTargeting in project bundletool by google.
the class MergingUtilsTest method mergeShardTargetings_equalTextureCompressionFormat_ok.
@Test
public void mergeShardTargetings_equalTextureCompressionFormat_ok() {
ApkTargeting targeting = apkTextureTargeting(textureCompressionTargeting(S3TC, ImmutableSet.of(ETC1_RGB8)));
assertThat(MergingUtils.mergeShardTargetings(targeting, targeting)).isEqualTo(apkTextureTargeting(textureCompressionTargeting(S3TC, ImmutableSet.of(ETC1_RGB8))));
}
use of com.android.bundle.Targeting.ApkTargeting in project bundletool by google.
the class MergingUtilsTest method mergeShardTargetings_differentDeviceTiers_ok.
@Test
public void mergeShardTargetings_differentDeviceTiers_ok() {
ApkTargeting targeting1 = apkDeviceTierTargeting(deviceTierTargeting(0, ImmutableList.of(1)));
ApkTargeting targeting2 = apkDeviceTierTargeting(deviceTierTargeting(0, ImmutableList.of(2)));
assertThat(MergingUtils.mergeShardTargetings(targeting1, targeting2)).isEqualTo(apkDeviceTierTargeting(deviceTierTargeting(0, ImmutableList.of(1, 2))));
}
use of com.android.bundle.Targeting.ApkTargeting in project bundletool by google.
the class MergingUtilsTest method mergeShardTargetings_equalAbis_ok.
@Test
public void mergeShardTargetings_equalAbis_ok() {
ApkTargeting targeting = apkAbiTargeting(AbiAlias.X86);
ApkTargeting merged = MergingUtils.mergeShardTargetings(targeting, targeting);
assertThat(merged).isEqualTo(targeting);
assertThat(merged.hasScreenDensityTargeting()).isFalse();
}
use of com.android.bundle.Targeting.ApkTargeting in project bundletool by google.
the class MergingUtilsTest method mergeShardTargetings_sdkTargetingSecondTargeting_throws.
@Test
public void mergeShardTargetings_sdkTargetingSecondTargeting_throws() {
ApkTargeting targeting = apkMinSdkTargeting(1);
CommandExecutionException exception = assertThrows(CommandExecutionException.class, () -> MergingUtils.mergeShardTargetings(apkAbiTargeting(AbiAlias.X86), targeting));
assertThat(exception).hasMessageThat().contains("Expecting only ABI, screen density, language and texture compression format" + " targeting");
}
Aggregations