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

Unified Diff: mojo/edk/system/test/test_io_thread.h

Issue 1473413002: EDK: Add a TestIOThread::IsCurrentAndRunning(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 | « mojo/edk/system/remote_message_pipe_unittest.cc ('k') | mojo/edk/system/test/test_io_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/test/test_io_thread.h
diff --git a/mojo/edk/system/test/test_io_thread.h b/mojo/edk/system/test/test_io_thread.h
index c96857b3a0ada8f33ee15fdeb425611491bb2b8b..a88fa558d22f9e2782af1028e2dac916bd0c78e1 100644
--- a/mojo/edk/system/test/test_io_thread.h
+++ b/mojo/edk/system/test/test_io_thread.h
@@ -30,6 +30,10 @@ class TestIOThread final {
void Start();
void Stop();
+ // Returns true if called on the I/O thread with the message loop running.
+ // (This may be called on any thread.)
+ bool IsCurrentAndRunning() const;
+
// Posts |task| to the I/O thread.
void PostTask(const base::Closure& task);
// Posts |task| to the I/O thread, blocking the calling thread until the
@@ -40,7 +44,7 @@ class TestIOThread final {
return static_cast<base::MessageLoopForIO*>(io_thread_.message_loop());
}
- const util::RefPtr<platform::TaskRunner>& task_runner() {
+ const util::RefPtr<platform::TaskRunner>& task_runner() const {
return io_task_runner_;
}
« no previous file with comments | « mojo/edk/system/remote_message_pipe_unittest.cc ('k') | mojo/edk/system/test/test_io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698