Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: components/previews/core/previews_black_list_item.cc

Issue 2448313002: Adding unit tests for PreviewsOptOutStoreSQL (Closed)
Patch Set: tbansal Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/previews/core/previews_black_list_item.cc
diff --git a/components/previews/core/previews_black_list_item.cc b/components/previews/core/previews_black_list_item.cc
index 9fd3286772ca7497406a48351b8cb89bc7fae591..59ba6cfe606c1f6265a255b8092d0272f9dccc72 100644
--- a/components/previews/core/previews_black_list_item.cc
+++ b/components/previews/core/previews_black_list_item.cc
@@ -50,11 +50,15 @@ void PreviewsBlackListItem::AddPreviewNavigation(bool opt_out,
DCHECK_LE(opt_out_records_.size(), max_stored_history_length_);
}
bool PreviewsBlackListItem::IsBlackListed(base::Time now) const {
DCHECK_LE(opt_out_records_.size(), max_stored_history_length_);
return most_recent_opt_out_time_ &&
now - most_recent_opt_out_time_.value() < max_black_list_duration_ &&
total_opt_out_ >= opt_out_black_list_threshold_;
}
+size_t PreviewsBlackListItem::OptOutRecordsSizeForTesting() const {
+ return opt_out_records_.size();
+}
+
} // namespace previews
« no previous file with comments | « components/previews/core/previews_black_list_item.h ('k') | components/previews/core/previews_opt_out_store_sql.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698