Index: mojo/system/test_utils.h |
diff --git a/mojo/system/test_utils.h b/mojo/system/test_utils.h |
index d40490f5f2a48d597dc16f5d6215cc94e30f8982..73949b9055be2825d35151e67b1c91175d8ea692 100644 |
--- a/mojo/system/test_utils.h |
+++ b/mojo/system/test_utils.h |
@@ -7,11 +7,14 @@ |
#include <stdint.h> |
-#include "base/basictypes.h" |
#include "base/callback_forward.h" |
+#include "base/compiler_specific.h" |
+#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
#include "base/task_runner.h" |
+#include "base/threading/thread.h" |
#include "base/time/time.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
namespace tracked_objects { |
class Location; |
@@ -47,6 +50,31 @@ void PostTaskAndWait(scoped_refptr<base::TaskRunner> task_runner, |
const tracked_objects::Location& from_here, |
const base::Closure& task); |
+// TestWithIOThreadBase -------------------------------------------------------- |
+ |
+class TestWithIOThreadBase : public testing::Test { |
+ public: |
+ TestWithIOThreadBase(); |
+ virtual ~TestWithIOThreadBase(); |
+ |
+ virtual void SetUp() OVERRIDE; |
+ virtual void TearDown() OVERRIDE; |
+ |
+ protected: |
+ base::MessageLoop* io_thread_message_loop() { |
+ return io_thread_.message_loop(); |
+ } |
+ |
+ scoped_refptr<base::TaskRunner> io_thread_task_runner() { |
+ return io_thread_message_loop()->message_loop_proxy(); |
+ } |
+ |
+ private: |
+ base::Thread io_thread_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TestWithIOThreadBase); |
+}; |
+ |
} // namespace test |
} // namespace system |
} // namespace mojo |