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

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

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 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 "chrome/browser/extensions/settings/settings_test_util.h" 5 #include "chrome/browser/extensions/settings/settings_test_util.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "chrome/common/extensions/extension.h" 8 #include "chrome/common/extensions/extension.h"
9 #include "chrome/browser/extensions/extension_system_factory.h" 9 #include "chrome/browser/extensions/extension_system_factory.h"
10 #include "chrome/browser/extensions/settings/settings_frontend.h" 10 #include "chrome/browser/extensions/settings/settings_frontend.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 namespace settings_test_util { 14 namespace settings_test_util {
15 15
16 // Intended as a StorageCallback from GetStorage. 16 // Intended as a StorageCallback from GetStorage.
17 static void AssignStorage(ValueStore** dst, ValueStore* src) { 17 static void AssignStorage(ValueStore** dst, ValueStore* src) {
18 *dst = src; 18 *dst = src;
19 } 19 }
20 20
21 ValueStore* GetStorage( 21 ValueStore* GetStorage(
22 const std::string& extension_id, 22 const std::string& extension_id,
23 settings_namespace::Namespace settings_namespace, 23 settings_namespace::Namespace settings_namespace,
24 SettingsFrontend* frontend) { 24 SettingsFrontend* frontend) {
25 ValueStore* storage = NULL; 25 ValueStore* storage = NULL;
26 frontend->RunWithStorage( 26 frontend->RunWithStorage(
27 extension_id, 27 extension_id,
28 settings_namespace, 28 settings_namespace,
29 base::Bind(&AssignStorage, &storage)); 29 base::Bind(&AssignStorage, &storage));
30 MessageLoop::current()->RunAllPending(); 30 MessageLoop::current()->RunUntilIdle();
31 return storage; 31 return storage;
32 } 32 }
33 33
34 ValueStore* GetStorage( 34 ValueStore* GetStorage(
35 const std::string& extension_id, SettingsFrontend* frontend) { 35 const std::string& extension_id, SettingsFrontend* frontend) {
36 return GetStorage(extension_id, settings_namespace::SYNC, frontend); 36 return GetStorage(extension_id, settings_namespace::SYNC, frontend);
37 } 37 }
38 38
39 // MockExtensionService 39 // MockExtensionService
40 40
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 ValueStore* ScopedSettingsStorageFactory::Create( 160 ValueStore* ScopedSettingsStorageFactory::Create(
161 const FilePath& base_path, 161 const FilePath& base_path,
162 const std::string& extension_id) { 162 const std::string& extension_id) {
163 DCHECK(delegate_.get()); 163 DCHECK(delegate_.get());
164 return delegate_->Create(base_path, extension_id); 164 return delegate_->Create(base_path, extension_id);
165 } 165 }
166 166
167 } // namespace settings_test_util 167 } // namespace settings_test_util
168 168
169 } // namespace extensions 169 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698