diff options
author | huangs <huangs@chromium.org> | 2015-05-07 23:27:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-08 06:27:52 +0000 |
commit | 73fa324f9528194085909ebcdf54566ddfae28ab (patch) | |
tree | a26583bc204c774a63e338a32340c12c7b2676de /components/favicon_base | |
parent | 09db9160ab8676c5683383c5f39b59fe877a4e32 (diff) | |
download | chromium_src-73fa324f9528194085909ebcdf54566ddfae28ab.zip chromium_src-73fa324f9528194085909ebcdf54566ddfae28ab.tar.gz chromium_src-73fa324f9528194085909ebcdf54566ddfae28ab.tar.bz2 |
[Large Icon Service] Adding unit test.
BUG=467712
Review URL: https://codereview.chromium.org/1124803005
Cr-Commit-Position: refs/heads/master@{#328933}
Diffstat (limited to 'components/favicon_base')
-rw-r--r-- | components/favicon_base/fallback_icon_style.cc | 7 | ||||
-rw-r--r-- | components/favicon_base/fallback_icon_style.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/components/favicon_base/fallback_icon_style.cc b/components/favicon_base/fallback_icon_style.cc index d3e395b..a3aa658 100644 --- a/components/favicon_base/fallback_icon_style.cc +++ b/components/favicon_base/fallback_icon_style.cc @@ -41,6 +41,13 @@ FallbackIconStyle::FallbackIconStyle() FallbackIconStyle::~FallbackIconStyle() { } +bool FallbackIconStyle::operator==(const FallbackIconStyle& other) const { + return background_color == other.background_color && + text_color == other.text_color && + font_size_ratio == other.font_size_ratio && + roundness == other.roundness; +} + void MatchFallbackIconTextColorAgainstBackgroundColor( FallbackIconStyle* style) { int luminance = color_utils::GetLuminanceForColor(style->background_color); diff --git a/components/favicon_base/fallback_icon_style.h b/components/favicon_base/fallback_icon_style.h index 84842ed..478efb8 100644 --- a/components/favicon_base/fallback_icon_style.h +++ b/components/favicon_base/fallback_icon_style.h @@ -30,6 +30,8 @@ struct FallbackIconStyle { // The roundness of the icon's corners. 0 => square icon, 1 => circle icon. double roundness; + + bool operator==(const FallbackIconStyle& other) const; }; // Reassigns |style|'s |text_color| to matches well against |background_color|. |