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

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: phajdan 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
« no previous file with comments | « chrome/test/base/test_web_dialog_observer.cc ('k') | chrome/test/base/tracing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c69447fa05f8cbd8e20c65c377baf1d2e99c62ca 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,11 @@ void TestingProfile::BlockUntilBookmarkModelLoaded() {
DCHECK(GetBookmarkModel());
if (GetBookmarkModel()->IsLoaded())
return;
- BookmarkLoadObserver observer;
+ base::RunLoop run_loop;
+ BookmarkLoadObserver observer(
+ ui_test_utils::GetQuitTaskForRunLoop(&run_loop));
GetBookmarkModel()->AddObserver(&observer);
- MessageLoop::current()->Run();
+ run_loop.Run();
GetBookmarkModel()->RemoveObserver(&observer);
DCHECK(GetBookmarkModel()->IsLoaded());
}
« no previous file with comments | « chrome/test/base/test_web_dialog_observer.cc ('k') | chrome/test/base/tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698