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

Unified Diff: base/prefs/pref_store_observer_mock.h

Issue 210063003: Refactor TestingPrefStore to make it useful to some tests of load errors and asynchrony. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 6 years, 9 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
« no previous file with comments | « base/prefs/overlay_user_pref_store_unittest.cc ('k') | base/prefs/pref_store_observer_mock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_store_observer_mock.h
diff --git a/base/prefs/pref_store_observer_mock.h b/base/prefs/pref_store_observer_mock.h
index 8252c3b359963e51d0b84012014bab43bf5f3436..594807f31e0acb4f69446d687cab5553df877a26 100644
--- a/base/prefs/pref_store_observer_mock.h
+++ b/base/prefs/pref_store_observer_mock.h
@@ -5,18 +5,28 @@
#ifndef BASE_PREFS_PREF_STORE_OBSERVER_MOCK_H_
#define BASE_PREFS_PREF_STORE_OBSERVER_MOCK_H_
-#include "base/basictypes.h"
+#include <string>
+#include <vector>
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/prefs/pref_store.h"
-#include "testing/gmock/include/gmock/gmock.h"
-// A gmock-ified implementation of PrefStore::Observer.
+// A mock implementation of PrefStore::Observer.
class PrefStoreObserverMock : public PrefStore::Observer {
public:
PrefStoreObserverMock();
virtual ~PrefStoreObserverMock();
- MOCK_METHOD1(OnPrefValueChanged, void(const std::string&));
- MOCK_METHOD1(OnInitializationCompleted, void(bool));
+ void VerifyAndResetChangedKey(const std::string& expected);
+
+ // PrefStore::Observer implementation
+ virtual void OnPrefValueChanged(const std::string& key) OVERRIDE;
+ virtual void OnInitializationCompleted(bool success) OVERRIDE;
+
+ std::vector<std::string> changed_keys;
+ bool initialized;
+ bool initialization_success; // Only valid if |initialized|.
private:
DISALLOW_COPY_AND_ASSIGN(PrefStoreObserverMock);
« no previous file with comments | « base/prefs/overlay_user_pref_store_unittest.cc ('k') | base/prefs/pref_store_observer_mock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698