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

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

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fetch/merge, no change Created 8 years, 6 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/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index a652086e73846155e8ee5861ac8695e6a30af1c4..8f303428cc6e8a48a9e4eaea8811194050377591 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -378,9 +378,10 @@ void TestingProfile::BlockUntilBookmarkModelLoaded() {
DCHECK(GetBookmarkModel());
if (GetBookmarkModel()->IsLoaded())
return;
- BookmarkLoadObserver observer;
+ MessageLoop::RunLoop run_loop;
+ BookmarkLoadObserver observer(run_loop.AsWeakPtr());
GetBookmarkModel()->AddObserver(&observer);
- MessageLoop::current()->Run();
+ run_loop.Run();
GetBookmarkModel()->RemoveObserver(&observer);
DCHECK(GetBookmarkModel()->IsLoaded());
}

Powered by Google App Engine
This is Rietveld 408576698