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

Unified Diff: ui/views/test/views_test_base.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 | « ui/views/focus/focus_manager_unittest_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/views_test_base.cc
diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc
index 329c9f331ae7b30647d2e70c6373cc0c65dab6b4..67c49c44ed534e81a5c4ce3bc5b8005d14824c45 100644
--- a/ui/views/test/views_test_base.cc
+++ b/ui/views/test/views_test_base.cc
@@ -4,6 +4,8 @@
#include "ui/views/test/views_test_base.h"
+#include "base/run_loop.h"
+
#if defined(USE_AURA)
#include "ui/aura/env.h"
#include "ui/aura/test/aura_test_helper.h"
@@ -47,12 +49,11 @@ void ViewsTestBase::TearDown() {
}
void ViewsTestBase::RunPendingMessages() {
+ base::RunLoop run_loop;
#if defined(USE_AURA)
- message_loop_.RunAllPendingWithDispatcher(
- aura::Env::GetInstance()->GetDispatcher());
-#else
- message_loop_.RunAllPending();
+ run_loop.set_dispatcher(aura::Env::GetInstance()->GetDispatcher());
#endif
+ run_loop.RunUntilIdle();
}
} // namespace views
« no previous file with comments | « ui/views/focus/focus_manager_unittest_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698