// Tell log4j to log everything for your test packages.
category.setLevel(Level.ALL);
final String ssversion = DevicePolicyConstants.CSS_MOBILE_PROFILE1;
DefaultDevice device = createDevice("Master", ssversion, null);
CSSProperty cssProperty;
// Test the default setup for CSSWAP.
cssConfigurator.initialise(config,
INTERNAL_DEVICE_FACTORY.createInternalDevice(device));
cssProperty = config.getCssVersion().getProperty(
StylePropertyDetails.VERTICAL_ALIGN);
// It should not have top or bottom.
assertFalse(cssProperty.supportsKeyword(VerticalAlignKeywords.TOP));
assertFalse(cssProperty.supportsKeyword(VerticalAlignKeywords.BOTTOM));
// It should have super and sub.
assertTrue(cssProperty.supportsKeyword(VerticalAlignKeywords.SUPER));
assertTrue(cssProperty.supportsKeyword(VerticalAlignKeywords.SUB));
final Map policies = new HashMap();
policies.put("ssversion", ssversion);
// Add top and bottom.
policies.put(
"x-css.properties.vertical-align.keyword.top.support", "full");
policies.put(
"x-css.properties.vertical-align.keyword.bottom.support", "full");
// Remove super and sub.
policies.put(
"x-css.properties.vertical-align.keyword.super.support", "none");
policies.put(
"x-css.properties.vertical-align.keyword.sub.support", "none");
device = createDevice("Master", policies, null);
cssConfigurator.initialise(config,
INTERNAL_DEVICE_FACTORY.createInternalDevice(device));
cssProperty = config.getCssVersion().getProperty(
StylePropertyDetails.VERTICAL_ALIGN);
// It should have top and bottom.
assertTrue(cssProperty.supportsKeyword(VerticalAlignKeywords.TOP));
assertTrue(cssProperty.supportsKeyword(VerticalAlignKeywords.BOTTOM));
// It should not have super or sub.
assertFalse(cssProperty.supportsKeyword(VerticalAlignKeywords.SUPER));
assertFalse(cssProperty.supportsKeyword(VerticalAlignKeywords.SUB));
}