Add wide color gamut and HDR resource qualifiers
Bug: 32984164
Test: Config_test, AaptConfig_test and aapt2_tests
Change-Id: Ie9c82bfe2d36b1d6180ee223250ab5bb2ce90dd4
diff --git a/tools/aapt2/ConfigDescription_test.cpp b/tools/aapt2/ConfigDescription_test.cpp
index 7933568..b88838a 100644
--- a/tools/aapt2/ConfigDescription_test.cpp
+++ b/tools/aapt2/ConfigDescription_test.cpp
@@ -102,6 +102,36 @@
EXPECT_EQ(std::string("notround-v23"), config.toString().string());
}
+TEST(ConfigDescriptionTest, TestWideColorGamutQualifier) {
+ ConfigDescription config;
+ EXPECT_TRUE(TestParse("widecg", &config));
+ EXPECT_EQ(android::ResTable_config::WIDE_COLOR_GAMUT_YES,
+ config.colorimetry & android::ResTable_config::MASK_WIDE_COLOR_GAMUT);
+ EXPECT_EQ(SDK_O, config.sdkVersion);
+ EXPECT_EQ(std::string("widecg-v26"), config.toString().string());
+
+ EXPECT_TRUE(TestParse("nowidecg", &config));
+ EXPECT_EQ(android::ResTable_config::WIDE_COLOR_GAMUT_NO,
+ config.colorimetry & android::ResTable_config::MASK_WIDE_COLOR_GAMUT);
+ EXPECT_EQ(SDK_O, config.sdkVersion);
+ EXPECT_EQ(std::string("nowidecg-v26"), config.toString().string());
+}
+
+TEST(ConfigDescriptionTest, TestHdrQualifier) {
+ ConfigDescription config;
+ EXPECT_TRUE(TestParse("highdr", &config));
+ EXPECT_EQ(android::ResTable_config::HDR_YES,
+ config.colorimetry & android::ResTable_config::MASK_HDR);
+ EXPECT_EQ(SDK_O, config.sdkVersion);
+ EXPECT_EQ(std::string("highdr-v26"), config.toString().string());
+
+ EXPECT_TRUE(TestParse("lowdr", &config));
+ EXPECT_EQ(android::ResTable_config::HDR_NO,
+ config.colorimetry & android::ResTable_config::MASK_HDR);
+ EXPECT_EQ(SDK_O, config.sdkVersion);
+ EXPECT_EQ(std::string("lowdr-v26"), config.toString().string());
+}
+
TEST(ConfigDescriptionTest, ParseVrAttribute) {
ConfigDescription config;
EXPECT_TRUE(TestParse("vrheadset", &config));