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

Unified Diff: chrome/test/base/ui_test_utils.cc

Issue 23710022: Convert NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED to CallbackList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean-up Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/ui_test_utils.cc
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index e4097e7a3edd7c1bea3d04ff65f634d7c0fb62d6..ffce5f3a9b59df0259b8a048c1b6969bb993ea9d 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -356,12 +356,12 @@ void WaitForTemplateURLServiceToLoad(TemplateURLService* service) {
if (service->loaded())
return;
- content::WindowedNotificationObserver observer(
- chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED,
- content::Source<TemplateURLService>(service));
+ base::RunLoop run_loop;
+ scoped_ptr<TemplateURLService::Subscription> sub =
+ service->RegisterOnLoadedCallback(
+ content::GetQuitTaskForRunLoop(&run_loop));
service->Load();
- observer.Wait();
-
+ content::RunThisRunLoop(&run_loop);
Avi (use Gerrit) 2013/10/02 22:27:52 MessageLoopRunner
Cait (Slow) 2013/10/03 15:36:45 Done.
ASSERT_TRUE(service->loaded());
}

Powered by Google App Engine
This is Rietveld 408576698