Search in sources :

Example 1 with DeviceSpecFromTargetingBuilder

use of com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder in project bundletool by google.

the class DeviceSpecUtilsTest method getDeviceSupportedTextureCompressionFormats.

@Test
public void getDeviceSupportedTextureCompressionFormats() {
    DeviceSpec deviceSpec = new DeviceSpecFromTargetingBuilder(DeviceSpec.getDefaultInstance()).setSupportedTextureCompressionFormats(textureCompressionTargeting(/* values= */
    ImmutableSet.of(TextureCompressionFormatAlias.ETC2, TextureCompressionFormatAlias.ASTC), /* alternatives= */
    ImmutableSet.of())).build();
    assertThat(DeviceSpecUtils.getDeviceSupportedTextureCompressionFormats(deviceSpec)).containsExactly(TextureCompressionFormatAlias.ETC2, TextureCompressionFormatAlias.ASTC);
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceSpecFromTargetingBuilder(com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder) Test(org.junit.Test)

Example 2 with DeviceSpecFromTargetingBuilder

use of com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder in project bundletool by google.

the class DeviceSpecUtilsTest method deviceSpecFromTargetingBuilder_setDeviceTier.

@Test
public void deviceSpecFromTargetingBuilder_setDeviceTier() {
    DeviceSpec deviceSpec = new DeviceSpecFromTargetingBuilder(DeviceSpec.getDefaultInstance()).setDeviceTier(deviceTierTargeting(/* value= */
    2, /* alternatives= */
    ImmutableList.of(1))).build();
    assertThat(deviceSpec.getDeviceTier().getValue()).isEqualTo(2);
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceSpecFromTargetingBuilder(com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder) Test(org.junit.Test)

Example 3 with DeviceSpecFromTargetingBuilder

use of com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder in project bundletool by google.

the class DeviceSpecUtilsTest method getGlEsVersion.

@Test
public void getGlEsVersion() {
    DeviceSpec deviceSpec = new DeviceSpecFromTargetingBuilder(DeviceSpec.getDefaultInstance()).setSupportedTextureCompressionFormats(textureCompressionTargeting(TextureCompressionFormatAlias.ETC2)).build();
    assertThat(DeviceSpecUtils.getGlEsVersion(deviceSpec)).hasValue(0x30000);
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceSpecFromTargetingBuilder(com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder) Test(org.junit.Test)

Example 4 with DeviceSpecFromTargetingBuilder

use of com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder in project bundletool by google.

the class DeviceSpecUtilsTest method deviceSpecFromTargetingBuilder_setSupportedTextureCompressionFormats.

@Test
public void deviceSpecFromTargetingBuilder_setSupportedTextureCompressionFormats() {
    DeviceSpec deviceSpec = new DeviceSpecFromTargetingBuilder(DeviceSpec.getDefaultInstance()).setSupportedTextureCompressionFormats(textureCompressionTargeting(/* values= */
    ImmutableSet.of(TextureCompressionFormatAlias.ETC2, TextureCompressionFormatAlias.ASTC), /* alternatives= */
    ImmutableSet.of())).build();
    assertThat(deviceSpec.getGlExtensionsList()).containsExactly("GL_KHR_texture_compression_astc_ldr");
    assertThat(deviceSpec.getDeviceFeaturesList()).containsExactly("reqGlEsVersion=0x30000");
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceSpecFromTargetingBuilder(com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder) Test(org.junit.Test)

Aggregations

DeviceSpec (com.android.bundle.Devices.DeviceSpec)4 DeviceSpecFromTargetingBuilder (com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder)4 Test (org.junit.Test)4