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

Unified Diff: chrome/browser/extensions/settings/settings_test_util.cc

Issue 8497065: Extension Settings API: make it so that when leveldb storage areas fail to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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/extensions/settings/settings_test_util.cc
diff --git a/chrome/browser/extensions/settings/settings_test_util.cc b/chrome/browser/extensions/settings/settings_test_util.cc
index 38869ac29e38567fe539da587582f03bb3806414..39d63cd212068d50a93360708359dde9d0c1a60d 100644
--- a/chrome/browser/extensions/settings/settings_test_util.cc
+++ b/chrome/browser/extensions/settings/settings_test_util.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/extensions/settings/settings_test_util.h"
#include "base/file_path.h"
+#include "chrome/browser/extensions/settings/settings_frontend.h"
+#include "chrome/browser/extensions/settings/settings_storage.h"
#include "chrome/common/extensions/extension.h"
namespace extensions {
@@ -12,8 +14,7 @@ namespace extensions {
namespace settings_test_util {
// Intended as a StorageCallback from GetStorage.
-static void AssignStorage(
- SettingsStorage** dst, SettingsStorage* src) {
+static void AssignStorage(SettingsStorage** dst, SettingsStorage* src) {
*dst = src;
}
@@ -27,6 +28,8 @@ SettingsStorage* GetStorage(
return storage;
}
+// MockExtesionService
+
MockExtensionService::MockExtensionService() {}
MockExtensionService::~MockExtensionService() {}
@@ -73,6 +76,8 @@ void MockExtensionService::AddExtension(
DCHECK(error.empty());
}
+// MockProfile
+
MockProfile::MockProfile(const FilePath& file_path)
: TestingProfile(file_path) {
event_router_.reset(new ExtensionEventRouter(this));
@@ -94,6 +99,32 @@ ExtensionEventRouter* MockProfile::GetExtensionEventRouter() {
return event_router_.get();
}
+// DelegatingSettingsStorageFactory
+
+DelegatingSettingsStorageFactory::DelegatingSettingsStorageFactory(
+ SettingsStorageFactory* delegate) : delegate_(delegate) {
+ DCHECK(delegate);
+}
+
+DelegatingSettingsStorageFactory::~DelegatingSettingsStorageFactory() {}
+
+void DelegatingSettingsStorageFactory::Reset(SettingsStorageFactory* delegate) {
+ DCHECK(delegate);
+ delegate_.reset(delegate);
+}
+
+SettingsStorage* DelegatingSettingsStorageFactory::Create(
+ const FilePath& base_path, const std::string& extension_id) {
+ return delegate_->Create(base_path, extension_id);
+}
+
+// NullSettingsStorageFactory
+
+SettingsStorage* NullSettingsStorageFactory::Create(
+ const FilePath& base_path, const std::string& extension_id) {
+ return NULL;
+}
+
} // namespace settings_test_util
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698