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

Unified Diff: components/suggestions/suggestions_store.h

Issue 816693003: SuggestionsStore unittests not using real time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years 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_store.h
diff --git a/components/suggestions/suggestions_store.h b/components/suggestions/suggestions_store.h
index 78ff7f6b17cb900816060ed5f2dbcb3ce3bdf0da..5f0e666264bc899a8a9d06210cee9974913eceda 100644
--- a/components/suggestions/suggestions_store.h
+++ b/components/suggestions/suggestions_store.h
@@ -6,6 +6,8 @@
#define COMPONENTS_SUGGESTIONS_SUGGESTIONS_STORE_H_
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/time/clock.h"
#include "components/suggestions/proto/suggestions.pb.h"
class PrefService;
@@ -39,13 +41,18 @@ class SuggestionsStore {
// Register SuggestionsStore related prefs in the Profile prefs.
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+ // Gains ownership of |clock|.
Matt Giuca 2014/12/18 22:51:13 Nit: This comment is not necessary (the ownership
gayane -on leave until 09-2017 2014/12/22 16:29:38 Done.
+ void SetClockForTesting(scoped_ptr<base::Clock> clock);
+
protected:
// Test seam. For simplicity of mock creation.
- SuggestionsStore() {}
+ SuggestionsStore();
private:
// The pref service used to persist the suggestions data.
PrefService* pref_service_;
+ // Can be set for testing.
+ scoped_ptr<base::Clock> clock_;
DISALLOW_COPY_AND_ASSIGN(SuggestionsStore);
« no previous file with comments | « no previous file | components/suggestions/suggestions_store.cc » ('j') | components/suggestions/suggestions_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698