use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleMatcherTest method matchesModuleTargeting_negative_wrongDeviceTier.
@Test
public void matchesModuleTargeting_negative_wrongDeviceTier() {
ModuleTargeting targeting = mergeModuleTargeting(moduleMinSdkVersionTargeting(21), moduleFeatureTargeting("feature1"), moduleDeviceGroupsTargeting("highRam"));
DeviceSpec deviceSpec = mergeSpecs(deviceWithSdk(22), deviceGroups("lowRam"));
ModuleMatcher moduleMatcher = new ModuleMatcher(deviceSpec);
assertThat(moduleMatcher.matchesModuleTargeting(targeting)).isFalse();
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleMatcherTest method matchesModuleTargeting_negative_sdkTooLow.
@Test
public void matchesModuleTargeting_negative_sdkTooLow() {
ModuleTargeting targeting = mergeModuleTargeting(moduleMinSdkVersionTargeting(21), moduleFeatureTargeting("feature1"));
DeviceSpec deviceSpecLowSdk = mergeSpecs(deviceWithSdk(19), deviceFeatures("feature1", "feature2"));
ModuleMatcher moduleMatcher = new ModuleMatcher(deviceSpecLowSdk);
assertThat(moduleMatcher.matchesModuleTargeting(targeting)).isFalse();
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleMatcherTest method matchesModuleTargeting_negative_openGlVersionTooLow.
@Test
public void matchesModuleTargeting_negative_openGlVersionTooLow() {
ModuleTargeting targeting = mergeModuleTargeting(moduleMinSdkVersionTargeting(21), moduleFeatureTargeting(CONDITIONAL_MODULES_OPEN_GL_NAME, 0x30001));
DeviceSpec deviceSpec = mergeSpecs(deviceWithSdk(22), deviceFeatures("reqGlEsVersion=0x30000"));
ModuleMatcher moduleMatcher = new ModuleMatcher(deviceSpec);
assertThat(moduleMatcher.matchesModuleTargeting(targeting)).isFalse();
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleMatcherTest method matchesModuleTargeting_positive.
@Test
public void matchesModuleTargeting_positive() {
ModuleTargeting targeting = mergeModuleTargeting(moduleMinSdkVersionTargeting(21), moduleFeatureTargeting("feature1"), moduleFeatureTargeting(CONDITIONAL_MODULES_OPEN_GL_NAME, 0x30001), moduleDeviceGroupsTargeting("highRam"));
DeviceSpec deviceSpec = mergeSpecs(deviceWithSdk(22), deviceFeatures("feature1", "feature2", "reqGlEsVersion=0x30002"), deviceGroups("highRam"));
ModuleMatcher moduleMatcher = new ModuleMatcher(deviceSpec);
assertThat(moduleMatcher.matchesModuleTargeting(targeting)).isTrue();
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleMatcherTest method matchesModuleTargeting_negative_featureNotPresent.
@Test
public void matchesModuleTargeting_negative_featureNotPresent() {
ModuleTargeting targeting = mergeModuleTargeting(moduleMinSdkVersionTargeting(21), moduleFeatureTargeting("feature1"));
DeviceSpec deviceSpecNoFeature = mergeSpecs(deviceWithSdk(21), deviceFeatures("feature2"));
ModuleMatcher moduleMatcher = new ModuleMatcher(deviceSpecNoFeature);
assertThat(moduleMatcher.matchesModuleTargeting(targeting)).isFalse();
}
Aggregations