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

Unified Diff: chrome/test/base/tracing.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/testing_profile.cc ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/tracing.cc
diff --git a/chrome/test/base/tracing.cc b/chrome/test/base/tracing.cc
index 790ab3c8016dde6ea53f0af9b6a6c8da843fd88c..3c29bba32366d94e776969d712e85d98ce62d7dc 100644
--- a/chrome/test/base/tracing.cc
+++ b/chrome/test/base/tracing.cc
@@ -38,7 +38,8 @@ class InProcessTraceController : public content::TraceSubscriber {
return false;
// Wait for OnEndTracingComplete() to quit the message loop.
// OnTraceDataCollected may be called multiple times while blocking here.
- ui_test_utils::RunMessageLoop();
+ message_loop_runner_ = new ui_test_utils::MessageLoopRunner;
+ message_loop_runner_->Run();
trace_buffer_.Finish();
trace_buffer_.SetOutputCallback(TraceResultBuffer::OutputCallback());
@@ -51,7 +52,7 @@ class InProcessTraceController : public content::TraceSubscriber {
// TraceSubscriber
virtual void OnEndTracingComplete() OVERRIDE {
- MessageLoopForUI::current()->Quit();
+ message_loop_runner_->Quit();
}
// TraceSubscriber
@@ -63,6 +64,8 @@ class InProcessTraceController : public content::TraceSubscriber {
// For collecting trace data asynchronously.
base::debug::TraceResultBuffer trace_buffer_;
+ scoped_refptr<ui_test_utils::MessageLoopRunner> message_loop_runner_;
+
DISALLOW_COPY_AND_ASSIGN(InProcessTraceController);
};
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | chrome/test/base/ui_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698