summaryrefslogtreecommitdiffstats
path: root/extensions/common/image_util_unittest.cc
diff options
context:
space:
mode:
authorlimasdf <limasdf@gmail.com>2016-03-10 03:14:33 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-10 11:15:37 +0000
commit2fc1c838798d0c76f1c135f1791d3989ab7a2b01 (patch)
tree3576eb540f370455cbb456b91d4c25ab12c46983 /extensions/common/image_util_unittest.cc
parent37f57d892222dc0ed816ae004074d7c80600ad46 (diff)
downloadchromium_src-2fc1c838798d0c76f1c135f1791d3989ab7a2b01.zip
chromium_src-2fc1c838798d0c76f1c135f1791d3989ab7a2b01.tar.gz
chromium_src-2fc1c838798d0c76f1c135f1791d3989ab7a2b01.tar.bz2
chrome.browserAction.setBadgeBackgroundColor accepts color keyword
Accepts color keyword like 'black', 'blue' from setBadgeBackgroundColor. Also, if unable to parse color string, returns proper error message TEST=browser_tests --gtest_filter=BrowserActionApiTest.BadgeBackgroundColor extensions_unittests --gtest_filter=ImageUtilTest.* BUG=593194 Review URL: https://codereview.chromium.org/1781563003 Cr-Commit-Position: refs/heads/master@{#380386}
Diffstat (limited to 'extensions/common/image_util_unittest.cc')
-rw-r--r--extensions/common/image_util_unittest.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/extensions/common/image_util_unittest.cc b/extensions/common/image_util_unittest.cc
index 8e7d80f..e4a81bb 100644
--- a/extensions/common/image_util_unittest.cc
+++ b/extensions/common/image_util_unittest.cc
@@ -108,4 +108,15 @@ TEST(ImageUtilTest, AcceptHsla) {
RunPassHslTest("hsla(0, 100%, 50%, 1)", SK_ColorRED);
}
+TEST(ImageUtilTest, BasicColorKeyword) {
+ SkColor color = 0;
+ EXPECT_TRUE(image_util::ParseCssColorString("red", &color));
+ EXPECT_EQ(color, SK_ColorRED);
+
+ EXPECT_TRUE(image_util::ParseCssColorString("blue", &color));
+ EXPECT_EQ(color, SK_ColorBLUE);
+
+ EXPECT_FALSE(image_util::ParseCssColorString("my_red", &color));
+}
+
} // namespace extensions