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

Unified Diff: base/test/thread_test_helper.h

Issue 369703003: Reduce usage of MessageLoopProxy in base/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Explicit Created 6 years, 5 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: base/test/thread_test_helper.h
diff --git a/base/test/thread_test_helper.h b/base/test/thread_test_helper.h
index 9521de60bfa774affd31ce3f3f478e21860c120c..79c59ffe1b59c30d19bcf8963a86268716343564 100644
--- a/base/test/thread_test_helper.h
+++ b/base/test/thread_test_helper.h
@@ -7,18 +7,20 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop_proxy.h"
#include "base/synchronization/waitable_event.h"
namespace base {
+class SequencedTaskRunner;
+
// Helper class that executes code on a given thread while blocking on the
// invoking thread. To use, derive from this class and overwrite RunTest. An
// alternative use of this class is to use it directly. It will then block
// until all pending tasks on a given thread have been executed.
class ThreadTestHelper : public RefCountedThreadSafe<ThreadTestHelper> {
public:
- explicit ThreadTestHelper(MessageLoopProxy* target_thread);
+ explicit ThreadTestHelper(
+ const scoped_refptr<SequencedTaskRunner>& target_task_runner);
// True if RunTest() was successfully executed on the target thread.
bool Run() WARN_UNUSED_RESULT;
@@ -37,7 +39,7 @@ class ThreadTestHelper : public RefCountedThreadSafe<ThreadTestHelper> {
void RunInThread();
bool test_result_;
- scoped_refptr<MessageLoopProxy> target_thread_;
+ scoped_refptr<SequencedTaskRunner> target_task_runner_;
WaitableEvent done_event_;
DISALLOW_COPY_AND_ASSIGN(ThreadTestHelper);

Powered by Google App Engine
This is Rietveld 408576698