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

Side by Side Diff: chrome/browser/intents/cws_intents_registry_unittest.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/intents/cws_intents_registry.h" 5 #include "chrome/browser/intents/cws_intents_registry.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 class CWSIntentsRegistryTest : public testing::Test { 154 class CWSIntentsRegistryTest : public testing::Test {
155 public: 155 public:
156 virtual void SetUp() { 156 virtual void SetUp() {
157 scoped_refptr<net::TestURLRequestContextGetter> context_getter( 157 scoped_refptr<net::TestURLRequestContextGetter> context_getter(
158 new net::TestURLRequestContextGetter(ui_loop_.message_loop_proxy())); 158 new net::TestURLRequestContextGetter(ui_loop_.message_loop_proxy()));
159 registry_.reset(context_getter); 159 registry_.reset(context_getter);
160 } 160 }
161 161
162 virtual void TearDown() { 162 virtual void TearDown() {
163 // Pump messages posted by the main thread. 163 // Pump messages posted by the main thread.
164 ui_loop_.RunAllPending(); 164 ui_loop_.RunUntilIdle();
165 } 165 }
166 166
167 CWSIntentsRegistry::IntentExtensionList WaitForResults() { 167 CWSIntentsRegistry::IntentExtensionList WaitForResults() {
168 ui_loop_.RunAllPending(); 168 ui_loop_.RunUntilIdle();
169 return extensions_; 169 return extensions_;
170 } 170 }
171 171
172 void Callback(const CWSIntentsRegistry::IntentExtensionList& extensions) { 172 void Callback(const CWSIntentsRegistry::IntentExtensionList& extensions) {
173 extensions_ = extensions; 173 extensions_ = extensions;
174 } 174 }
175 175
176 void RunRequest(const std::string& action, const std::string& mime, 176 void RunRequest(const std::string& action, const std::string& mime,
177 const std::string& response) { 177 const std::string& response) {
178 extensions_.clear(); 178 extensions_.clear();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // localization data exists. 266 // localization data exists.
267 response = kCWSResponseValidL10n; 267 response = kCWSResponseValidL10n;
268 response += kLocaleDataEn; 268 response += kLocaleDataEn;
269 response += kCWSResponseValidL10nPostfix; 269 response += kCWSResponseValidL10nPostfix;
270 extension_l10n_util::SetProcessLocale("de"); 270 extension_l10n_util::SetProcessLocale("de");
271 RunRequest(kEditAction, kImagePngType, response); 271 RunRequest(kEditAction, kImagePngType, response);
272 ASSERT_EQ(1UL, extensions_.size()); 272 ASSERT_EQ(1UL, extensions_.size());
273 EXPECT_EQ(std::string("__MSG_name__"), 273 EXPECT_EQ(std::string("__MSG_name__"),
274 UTF16ToUTF8(extensions_[0].name)); 274 UTF16ToUTF8(extensions_[0].name));
275 } 275 }
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/test_util.cc ('k') | chrome/browser/intents/web_intents_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698