| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 216 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 217 profile_.reset(new util::MockProfile(temp_dir_.path())); | 217 profile_.reset(new util::MockProfile(temp_dir_.path())); |
| 218 storage_factory_->Reset(new LeveldbSettingsStorageFactory()); | 218 storage_factory_->Reset(new LeveldbSettingsStorageFactory()); |
| 219 frontend_.reset( | 219 frontend_.reset( |
| 220 SettingsFrontend::Create(storage_factory_.get(), profile_.get())); | 220 SettingsFrontend::Create(storage_factory_.get(), profile_.get())); |
| 221 } | 221 } |
| 222 | 222 |
| 223 virtual void TearDown() OVERRIDE { | 223 virtual void TearDown() OVERRIDE { |
| 224 frontend_.reset(); | 224 frontend_.reset(); |
| 225 profile_.reset(); | 225 profile_.reset(); |
| 226 // Execute any pending deletion tasks. |
| 227 message_loop_.RunAllPending(); |
| 226 } | 228 } |
| 227 | 229 |
| 228 protected: | 230 protected: |
| 229 // Adds a record of an extension or app to the extension service, then returns | 231 // Adds a record of an extension or app to the extension service, then returns |
| 230 // its storage area. | 232 // its storage area. |
| 231 ValueStore* AddExtensionAndGetStorage( | 233 ValueStore* AddExtensionAndGetStorage( |
| 232 const std::string& id, Extension::Type type) { | 234 const std::string& id, Extension::Type type) { |
| 233 profile_->GetMockExtensionService()->AddExtensionWithId(id, type); | 235 profile_->GetMockExtensionService()->AddExtensionWithId(id, type); |
| 234 return util::GetStorage(id, frontend_.get()); | 236 return util::GetStorage(id, frontend_.get()); |
| 235 } | 237 } |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 DictionaryValue expected; | 1373 DictionaryValue expected; |
| 1372 expected.Set("large_value", large_value.DeepCopy()); | 1374 expected.Set("large_value", large_value.DeepCopy()); |
| 1373 EXPECT_PRED_FORMAT2(SettingsEq, expected, storage1->Get()); | 1375 EXPECT_PRED_FORMAT2(SettingsEq, expected, storage1->Get()); |
| 1374 EXPECT_PRED_FORMAT2(SettingsEq, expected, storage2->Get()); | 1376 EXPECT_PRED_FORMAT2(SettingsEq, expected, storage2->Get()); |
| 1375 } | 1377 } |
| 1376 | 1378 |
| 1377 GetSyncableService(model_type)->StopSyncing(model_type); | 1379 GetSyncableService(model_type)->StopSyncing(model_type); |
| 1378 } | 1380 } |
| 1379 | 1381 |
| 1380 } // namespace extensions | 1382 } // namespace extensions |
| OLD | NEW |