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

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

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/test/test_io_thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/test/test_io_thread.cc
diff --git a/mojo/edk/system/test/test_io_thread.cc b/mojo/edk/system/test/test_io_thread.cc
index 9dcc873d5c5907ec536b9e972a5c4fe2cd70baa6..eaa218a9fa06707598ce8b204e02e4610e76cf06 100644
--- a/mojo/edk/system/test/test_io_thread.cc
+++ b/mojo/edk/system/test/test_io_thread.cc
@@ -55,6 +55,11 @@ void TestIOThread::Stop() {
io_thread_started_ = false;
}
+bool TestIOThread::IsCurrentAndRunning() const {
+ return base::MessageLoop::current() == io_thread_.message_loop() &&
+ io_thread_.message_loop()->is_running();
+}
+
void TestIOThread::PostTask(const base::Closure& task) {
io_task_runner_->PostTask(task);
}
« no previous file with comments | « mojo/edk/system/test/test_io_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698