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

Unified Diff: chrome/browser/extensions/extension_settings_storage_unittest.cc

Issue 7775008: Enable sync for the settings from the Extension Settings API. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Review #6 Created 9 years, 3 months 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/extension_settings_storage_unittest.cc
diff --git a/chrome/browser/extensions/extension_settings_storage_unittest.cc b/chrome/browser/extensions/extension_settings_storage_unittest.cc
index fc1a36141baab01f36b266a0becb5112fb2239a5..80d646167022e5d7842947e257056787a149bb36 100644
--- a/chrome/browser/extensions/extension_settings_storage_unittest.cc
+++ b/chrome/browser/extensions/extension_settings_storage_unittest.cc
@@ -51,7 +51,9 @@ ExtensionSettingsStorageTest::ExtensionSettingsStorageTest()
empty_dict_(new DictionaryValue),
dict1_(new DictionaryValue),
dict12_(new DictionaryValue),
- dict123_(new DictionaryValue) {
+ dict123_(new DictionaryValue),
+ ui_thread_(BrowserThread::UI, MessageLoop::current()),
+ file_thread_(BrowserThread::FILE, MessageLoop::current()) {
val1_.reset(Value::CreateStringValue(key1_ + "Value"));
val2_.reset(Value::CreateStringValue(key2_ + "Value"));
val3_.reset(Value::CreateStringValue(key3_ + "Value"));
@@ -77,17 +79,16 @@ ExtensionSettingsStorageTest::ExtensionSettingsStorageTest()
ExtensionSettingsStorageTest::~ExtensionSettingsStorageTest() {}
void ExtensionSettingsStorageTest::SetUp() {
- ui_message_loop_.reset(new MessageLoopForUI());
- ui_thread_.reset(
- new BrowserThread(BrowserThread::UI, MessageLoop::current()));
- file_thread_.reset(
- new BrowserThread(BrowserThread::FILE, MessageLoop::current()));
-
- FilePath temp_dir;
- file_util::CreateNewTempDirectory(FilePath::StringType(), &temp_dir);
- settings_ = new ExtensionSettings(temp_dir);
- storage_ = (GetParam())(settings_.get(), "fakeExtension");
- DCHECK(storage_ != NULL);
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ settings_.reset(new ExtensionSettings(temp_dir_.path()));
+ storage_ = (GetParam())(*settings_, "fakeExtension");
+ ASSERT_TRUE(storage_ != NULL);
+}
+
+void ExtensionSettingsStorageTest::TearDown() {
+ // Must do this explicitly here so that it's destroyed before the
+ // message loops are.
+ settings_.reset();
}
TEST_P(ExtensionSettingsStorageTest, GetWhenEmpty) {

Powered by Google App Engine
This is Rietveld 408576698