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

Side by Side Diff: chrome/browser/extensions/settings/settings_apitest.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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 void FinalReplyWhenSatisfied( 123 void FinalReplyWhenSatisfied(
124 Namespace settings_namespace, 124 Namespace settings_namespace,
125 const std::string& normal_action, 125 const std::string& normal_action,
126 const std::string& incognito_action) { 126 const std::string& incognito_action) {
127 MaybeLoadAndReplyWhenSatisfied( 127 MaybeLoadAndReplyWhenSatisfied(
128 settings_namespace, normal_action, incognito_action, NULL, true); 128 settings_namespace, normal_action, incognito_action, NULL, true);
129 } 129 }
130 130
131 void InitSync(syncer::SyncChangeProcessor* sync_processor) { 131 void InitSync(syncer::SyncChangeProcessor* sync_processor) {
132 MessageLoop::current()->RunAllPending(); 132 MessageLoop::current()->RunUntilIdle();
133 InitSyncWithSyncableService( 133 InitSyncWithSyncableService(
134 sync_processor, 134 sync_processor,
135 browser()->profile()->GetExtensionService()->settings_frontend()-> 135 browser()->profile()->GetExtensionService()->settings_frontend()->
136 GetBackendForSync(kModelType)); 136 GetBackendForSync(kModelType));
137 } 137 }
138 138
139 void SendChanges(const syncer::SyncChangeList& change_list) { 139 void SendChanges(const syncer::SyncChangeList& change_list) {
140 MessageLoop::current()->RunAllPending(); 140 MessageLoop::current()->RunUntilIdle();
141 SendChangesToSyncableService( 141 SendChangesToSyncableService(
142 change_list, 142 change_list,
143 browser()->profile()->GetExtensionService()->settings_frontend()-> 143 browser()->profile()->GetExtensionService()->settings_frontend()->
144 GetBackendForSync(kModelType)); 144 GetBackendForSync(kModelType));
145 } 145 }
146 146
147 #if defined(ENABLE_CONFIGURATION_POLICY) 147 #if defined(ENABLE_CONFIGURATION_POLICY)
148 void SetPolicies(const base::DictionaryValue& policies) { 148 void SetPolicies(const base::DictionaryValue& policies) {
149 scoped_ptr<policy::PolicyBundle> bundle(new policy::PolicyBundle()); 149 scoped_ptr<policy::PolicyBundle> bundle(new policy::PolicyBundle());
150 policy::PolicyMap& policy_map = bundle->Get( 150 policy::PolicyMap& policy_map = bundle->Get(
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 SettingsFrontend* frontend = 486 SettingsFrontend* frontend =
487 browser()->profile()->GetExtensionService()->settings_frontend(); 487 browser()->profile()->GetExtensionService()->settings_frontend();
488 frontend->DisableStorageForTesting(MANAGED); 488 frontend->DisableStorageForTesting(MANAGED);
489 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); 489 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED));
490 // Now run the extension. 490 // Now run the extension.
491 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) 491 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled"))
492 << message_; 492 << message_;
493 } 493 }
494 494
495 } // namespace extensions 495 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698