From 73fa324f9528194085909ebcdf54566ddfae28ab Mon Sep 17 00:00:00 2001 From: huangs Date: Thu, 7 May 2015 23:27:15 -0700 Subject: [Large Icon Service] Adding unit test. BUG=467712 Review URL: https://codereview.chromium.org/1124803005 Cr-Commit-Position: refs/heads/master@{#328933} --- components/favicon_base/fallback_icon_style.cc | 7 +++++++ components/favicon_base/fallback_icon_style.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'components/favicon_base') 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|. -- cgit v1.1