| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 virtual void SetUp() OVERRIDE { | 74 virtual void SetUp() OVERRIDE { |
| 75 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 75 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 76 profile_.reset(new util::MockProfile(temp_dir_.path())); | 76 profile_.reset(new util::MockProfile(temp_dir_.path())); |
| 77 ResetFrontend(); | 77 ResetFrontend(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 virtual void TearDown() OVERRIDE { | 80 virtual void TearDown() OVERRIDE { |
| 81 frontend_.reset(); | 81 frontend_.reset(); |
| 82 profile_.reset(); | 82 profile_.reset(); |
| 83 // Execute any pending deletion tasks. |
| 84 message_loop_.RunAllPending(); |
| 83 } | 85 } |
| 84 | 86 |
| 85 protected: | 87 protected: |
| 86 void ResetFrontend() { | 88 void ResetFrontend() { |
| 87 storage_factory_->Reset(new LeveldbSettingsStorageFactory()); | 89 storage_factory_->Reset(new LeveldbSettingsStorageFactory()); |
| 88 frontend_.reset( | 90 frontend_.reset( |
| 89 SettingsFrontend::Create(storage_factory_.get(), profile_.get())); | 91 SettingsFrontend::Create(storage_factory_.get(), profile_.get())); |
| 90 } | 92 } |
| 91 | 93 |
| 92 ScopedTempDir temp_dir_; | 94 ScopedTempDir temp_dir_; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 313 |
| 312 frontend_->RunWithStorage( | 314 frontend_->RunWithStorage( |
| 313 id, settings::SYNC, base::Bind(&UnlimitedSyncStorageTestCallback)); | 315 id, settings::SYNC, base::Bind(&UnlimitedSyncStorageTestCallback)); |
| 314 frontend_->RunWithStorage( | 316 frontend_->RunWithStorage( |
| 315 id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback)); | 317 id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback)); |
| 316 | 318 |
| 317 MessageLoop::current()->RunAllPending(); | 319 MessageLoop::current()->RunAllPending(); |
| 318 } | 320 } |
| 319 | 321 |
| 320 } // namespace extensions | 322 } // namespace extensions |
| OLD | NEW |