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

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: darin feedback 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..b1a20eee80123b0b781b674240ef94705cc42910 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -11,6 +11,7 @@
#include "base/file_util.h"
#include "base/message_loop_proxy.h"
#include "base/path_service.h"
+#include "base/run_loop.h"
#include "base/string_number_conversions.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
@@ -378,9 +379,10 @@ void TestingProfile::BlockUntilBookmarkModelLoaded() {
DCHECK(GetBookmarkModel());
if (GetBookmarkModel()->IsLoaded())
return;
- BookmarkLoadObserver observer;
+ base::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