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

Unified Diff: components/suggestions/suggestions_service_impl.h

Issue 2869013004: Test SuggestionsServiceImpl without friending anything (Closed)
Patch Set: Created 3 years, 7 months 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/suggestions/suggestions_service_impl.h
diff --git a/components/suggestions/suggestions_service_impl.h b/components/suggestions/suggestions_service_impl.h
index dac972dd7edcaddaba52c048a23749cd5d6e72c5..f791d97f390259b7adbfdc86e8e91b3f2d95cfcf 100644
--- a/components/suggestions/suggestions_service_impl.h
+++ b/components/suggestions/suggestions_service_impl.h
@@ -84,26 +84,17 @@ class SuggestionsServiceImpl : public SuggestionsService,
// Register SuggestionsService related prefs in the Profile prefs.
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
- private:
- friend class SuggestionsServiceTest;
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, FetchSuggestionsData);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest,
- FetchSuggestionsDataSyncDisabled);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest,
- FetchSuggestionsDataNoAccessToken);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest,
- IssueRequestIfNoneOngoingError);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest,
- IssueRequestIfNoneOngoingResponseNotOK);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, BlacklistURL);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, BlacklistURLRequestFails);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, ClearBlacklist);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, UndoBlacklistURL);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest,
- GetBlacklistedUrlBlacklistRequest);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, UpdateBlacklistDelay);
- FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, CheckDefaultTimeStamps);
+ base::TimeDelta blacklist_delay_for_testing() const {
+ return scheduling_delay_;
+ }
+ void set_blacklist_delay_for_testing(base::TimeDelta delay) {
+ scheduling_delay_ = delay;
+ }
+ bool has_pending_request_for_testing() const {
+ return !!pending_request_.get();
+ }
+ private:
// Helpers to build the various suggestions URLs. These are static members
// rather than local functions in the .cc file to make them accessible to
// tests.
@@ -160,10 +151,6 @@ class SuggestionsServiceImpl : public SuggestionsService,
// Adds extra data to suggestions profile.
void PopulateExtraData(SuggestionsProfile* suggestions);
- // Test seams.
- base::TimeDelta blacklist_delay() const { return scheduling_delay_; }
- void set_blacklist_delay(base::TimeDelta delay) { scheduling_delay_ = delay; }
-
base::ThreadChecker thread_checker_;
SigninManagerBase* signin_manager_;

Powered by Google App Engine
This is Rietveld 408576698