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

Side by Side Diff: chrome/browser/extensions/settings/settings_frontend_unittest.cc

Issue 10784035: Refactored SettingsFrontend and forwarding of calls to the backends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/settings/settings_frontend.cc ('k') | chrome/browser/extensions/settings/settings_namespace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698