Index: chrome/browser/prefs/testing_pref_store.h |
diff --git a/chrome/browser/prefs/dummy_pref_store.h b/chrome/browser/prefs/testing_pref_store.h |
similarity index 61% |
rename from chrome/browser/prefs/dummy_pref_store.h |
rename to chrome/browser/prefs/testing_pref_store.h |
index 4a4e6bacda183bd0cda0bfdb9fe459905bf66d7e..cb73a8144561b107a84af58bdd422b18764368e4 100644 |
--- a/chrome/browser/prefs/dummy_pref_store.h |
+++ b/chrome/browser/prefs/testing_pref_store.h |
@@ -2,22 +2,23 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_PREFS_DUMMY_PREF_STORE_H_ |
-#define CHROME_BROWSER_PREFS_DUMMY_PREF_STORE_H_ |
+#ifndef CHROME_TEST_TESTING_PREF_STORE_H_ |
+#define CHROME_TEST_TESTING_PREF_STORE_H_ |
#pragma once |
#include "base/basictypes.h" |
#include "base/scoped_ptr.h" |
-#include "chrome/common/pref_store.h" |
+#include "chrome/common/pref_store_base.h" |
class DictionaryValue; |
-// |DummyPrefStore| is a stub implementation of the |PrefStore| interface. |
-// It allows to get and set the state of the |PrefStore|. |
-class DummyPrefStore : public PrefStore { |
+// |TestingPrefStore| is a stub implementation of the |PrefStore| interface. |
+// It allows to get and set the state of the |PrefStore| as well as triggering |
+// notifications. |
+class TestingPrefStore : public PrefStoreBase { |
public: |
- DummyPrefStore(); |
- virtual ~DummyPrefStore() {} |
+ TestingPrefStore(); |
+ virtual ~TestingPrefStore() {} |
virtual DictionaryValue* prefs() const { return prefs_.get(); } |
@@ -34,6 +35,10 @@ class DummyPrefStore : public PrefStore { |
virtual void set_prefs_written(bool status) { prefs_written_ = status; } |
virtual bool get_prefs_written() { return prefs_written_; } |
+ // Publish these functions so tests can call them from the outside. |
+ void NotifyPrefValueChanged(const std::string& key); |
+ void NotifyInitializationCompleted(); |
+ |
private: |
scoped_ptr<DictionaryValue> prefs_; |
@@ -43,7 +48,7 @@ class DummyPrefStore : public PrefStore { |
// Flag that indicates if the method WritePrefs was called. |
bool prefs_written_; |
- DISALLOW_COPY_AND_ASSIGN(DummyPrefStore); |
+ DISALLOW_COPY_AND_ASSIGN(TestingPrefStore); |
}; |
-#endif // CHROME_BROWSER_PREFS_DUMMY_PREF_STORE_H_ |
+#endif // CHROME_TEST_TESTING_PREF_STORE_H_ |