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

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

Issue 8670012: Extension Settings API: move the API functions into an object SettingsNamepace, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bug / 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/settings_frontend_unittest.cc
diff --git a/chrome/browser/extensions/settings/settings_frontend_unittest.cc b/chrome/browser/extensions/settings/settings_frontend_unittest.cc
index cbebf43339091bf998518acb22b5ccb0377a75c6..136f578253effbe892ee7e26b189e69f2f14af4b 100644
--- a/chrome/browser/extensions/settings/settings_frontend_unittest.cc
+++ b/chrome/browser/extensions/settings/settings_frontend_unittest.cc
@@ -29,13 +29,15 @@ const SettingsStorage::WriteOptions DEFAULTS = SettingsStorage::DEFAULTS;
// A SettingsStorageFactory which always returns NULL.
class NullSettingsStorageFactory : public SettingsStorageFactory {
public:
- virtual ~NullSettingsStorageFactory() {}
-
// SettingsStorageFactory implementation.
virtual SettingsStorage* Create(
const FilePath& base_path, const std::string& extension_id) OVERRIDE {
return NULL;
}
+
+ private:
+ // SettingsStorageFactory is refcounted.
+ virtual ~NullSettingsStorageFactory() {}
};
}
@@ -43,7 +45,8 @@ class NullSettingsStorageFactory : public SettingsStorageFactory {
class ExtensionSettingsFrontendTest : public testing::Test {
public:
ExtensionSettingsFrontendTest()
- : ui_thread_(BrowserThread::UI, MessageLoop::current()),
+ : storage_factory_(new ScopedSettingsStorageFactory()),
+ ui_thread_(BrowserThread::UI, MessageLoop::current()),
file_thread_(BrowserThread::FILE, MessageLoop::current()) {}
virtual void SetUp() OVERRIDE {
@@ -59,17 +62,15 @@ class ExtensionSettingsFrontendTest : public testing::Test {
protected:
void ResetFrontend() {
- storage_factory_ =
- new ScopedSettingsStorageFactory(new SettingsLeveldbStorage::Factory());
- frontend_.reset(SettingsFrontend::Create(storage_factory_, profile_.get()));
+ storage_factory_->Reset(new SettingsLeveldbStorage::Factory());
+ frontend_.reset(
+ SettingsFrontend::Create(storage_factory_.get(), profile_.get()));
}
ScopedTempDir temp_dir_;
scoped_ptr<MockProfile> profile_;
scoped_ptr<SettingsFrontend> frontend_;
-
- // Owned by |frontend_|.
- ScopedSettingsStorageFactory* storage_factory_;
+ scoped_refptr<ScopedSettingsStorageFactory> storage_factory_;
private:
MessageLoop message_loop_;
« no previous file with comments | « chrome/browser/extensions/settings/settings_frontend.cc ('k') | chrome/browser/extensions/settings/settings_leveldb_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698