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

Unified Diff: chrome/browser/extensions/settings/testing_settings_storage.h

Issue 8539037: Extension Settings API: make it so that when changes received from Sync fail to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments, sync 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/testing_settings_storage.h
diff --git a/chrome/browser/extensions/settings/in_memory_settings_storage.h b/chrome/browser/extensions/settings/testing_settings_storage.h
similarity index 59%
rename from chrome/browser/extensions/settings/in_memory_settings_storage.h
rename to chrome/browser/extensions/settings/testing_settings_storage.h
index 9fa83d32ae88b66aac129073aa72eed8c2365ee4..3bbfe40b3a197dbddf92043322f243a383065301 100644
--- a/chrome/browser/extensions/settings/in_memory_settings_storage.h
+++ b/chrome/browser/extensions/settings/testing_settings_storage.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_IN_MEMORY_SETTINGS_STORAGE_H_
-#define CHROME_BROWSER_EXTENSIONS_SETTINGS_IN_MEMORY_SETTINGS_STORAGE_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_TESTING_SETTINGS_STORAGE_H_
+#define CHROME_BROWSER_EXTENSIONS_SETTINGS_TESTING_SETTINGS_STORAGE_H_
#pragma once
#include "base/compiler_specific.h"
@@ -11,10 +11,15 @@
namespace extensions {
-// In-memory storage, as opposed to SettingsLeveldbStorage.
-class InMemorySettingsStorage : public SettingsStorage {
+// SettingsStorage for testing, with an in-memory storage but the ability to
+// optionally fail all operations.
+class TestingSettingsStorage : public SettingsStorage {
public:
- InMemorySettingsStorage() {}
+ TestingSettingsStorage();
+ virtual ~TestingSettingsStorage();
+
+ // Sets whether to fail all requests (default is false).
+ void SetFailAllRequests(bool fail_all_requests);
// SettingsStorage implementation.
virtual ReadResult Get(const std::string& key) OVERRIDE;
@@ -29,9 +34,11 @@ class InMemorySettingsStorage : public SettingsStorage {
private:
DictionaryValue storage_;
- DISALLOW_COPY_AND_ASSIGN(InMemorySettingsStorage);
+ bool fail_all_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestingSettingsStorage);
};
} // namespace extensions
-#endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_IN_MEMORY_SETTINGS_STORAGE_H_
+#endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_TESTING_SETTINGS_STORAGE_H_

Powered by Google App Engine
This is Rietveld 408576698