OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_PREFS_PREF_STORE_OBSERVER_MOCK_H_ | 5 #ifndef BASE_PREFS_PREF_STORE_OBSERVER_MOCK_H_ |
6 #define BASE_PREFS_PREF_STORE_OBSERVER_MOCK_H_ | 6 #define BASE_PREFS_PREF_STORE_OBSERVER_MOCK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/prefs/pref_store.h" | 13 #include "components/prefs/pref_store.h" |
14 | 14 |
15 // A mock implementation of PrefStore::Observer. | 15 // A mock implementation of PrefStore::Observer. |
16 class PrefStoreObserverMock : public PrefStore::Observer { | 16 class PrefStoreObserverMock : public PrefStore::Observer { |
17 public: | 17 public: |
18 PrefStoreObserverMock(); | 18 PrefStoreObserverMock(); |
19 ~PrefStoreObserverMock() override; | 19 ~PrefStoreObserverMock() override; |
20 | 20 |
21 void VerifyAndResetChangedKey(const std::string& expected); | 21 void VerifyAndResetChangedKey(const std::string& expected); |
22 | 22 |
23 // PrefStore::Observer implementation | 23 // PrefStore::Observer implementation |
24 void OnPrefValueChanged(const std::string& key) override; | 24 void OnPrefValueChanged(const std::string& key) override; |
25 void OnInitializationCompleted(bool success) override; | 25 void OnInitializationCompleted(bool success) override; |
26 | 26 |
27 std::vector<std::string> changed_keys; | 27 std::vector<std::string> changed_keys; |
28 bool initialized; | 28 bool initialized; |
29 bool initialization_success; // Only valid if |initialized|. | 29 bool initialization_success; // Only valid if |initialized|. |
30 | 30 |
31 private: | 31 private: |
32 DISALLOW_COPY_AND_ASSIGN(PrefStoreObserverMock); | 32 DISALLOW_COPY_AND_ASSIGN(PrefStoreObserverMock); |
33 }; | 33 }; |
34 | 34 |
35 #endif // BASE_PREFS_PREF_STORE_OBSERVER_MOCK_H_ | 35 #endif // BASE_PREFS_PREF_STORE_OBSERVER_MOCK_H_ |
OLD | NEW |