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

Unified Diff: chrome/browser/prefs/testing_pref_store.h

Issue 5441002: Clean up pref change notification handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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: 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_

Powered by Google App Engine
This is Rietveld 408576698