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

Unified Diff: content/browser/browser_main_loop.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_frame/test/chrome_frame_test_utils.h ('k') | content/test/test_navigation_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 5ce5c3e6a114eaf79069e1754c933edf19efebf5..2932aeb6cef63243ef55b6ae436a934849a35d43 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -12,6 +12,7 @@
#include "base/message_loop.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
+#include "base/run_loop.h"
#include "base/string_number_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "content/browser/browser_thread_impl.h"
@@ -634,16 +635,16 @@ void BrowserMainLoop::InitializeToolkit() {
}
void BrowserMainLoop::MainMessageLoopRun() {
- if (parameters_.ui_task)
- MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task);
-
-#if defined(OS_MACOSX)
- MessageLoopForUI::current()->Run();
-#elif defined(OS_ANDROID)
+#if defined(OS_ANDROID)
// Android's main message loop is the Java message loop.
NOTREACHED();
#else
- MessageLoopForUI::current()->RunWithDispatcher(NULL);
+ DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
+ if (parameters_.ui_task)
+ MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task);
+
+ base::RunLoop run_loop;
+ run_loop.Run();
#endif
}
« no previous file with comments | « chrome_frame/test/chrome_frame_test_utils.h ('k') | content/test/test_navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698