Index: mojo/edk/system/test_utils.h |
diff --git a/third_party/mojo/src/mojo/edk/system/test_utils.h b/mojo/edk/system/test_utils.h |
similarity index 67% |
copy from third_party/mojo/src/mojo/edk/system/test_utils.h |
copy to mojo/edk/system/test_utils.h |
index c821dc1d224052119e83fda543045908e803a414..cf244b3a6df843c9d38d2ed986f0dd3a2047209d 100644 |
--- a/third_party/mojo/src/mojo/edk/system/test_utils.h |
+++ b/mojo/edk/system/test_utils.h |
@@ -2,15 +2,18 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_TEST_UTILS_H_ |
-#define THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_TEST_UTILS_H_ |
+#ifndef MOJO_EDK_SYSTEM_TEST_UTILS_H_ |
+#define MOJO_EDK_SYSTEM_TEST_UTILS_H_ |
+#include "base/test/test_io_thread.h" |
#include "base/time/time.h" |
+#include "mojo/edk/test/scoped_ipc_support.h" |
#include "mojo/public/c/system/types.h" |
#include "mojo/public/cpp/system/macros.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
namespace mojo { |
-namespace system { |
+namespace edk { |
namespace test { |
MojoDeadline DeadlineFromMilliseconds(unsigned milliseconds); |
@@ -51,8 +54,25 @@ class Stopwatch { |
MOJO_DISALLOW_COPY_AND_ASSIGN(Stopwatch); |
}; |
+// A base class which initializes and shuts down the necessary objects so that |
+// Mojo system calls can be made. |
+class MojoSystemTest : public testing::Test { |
+ public: |
+ MojoSystemTest(); |
+ ~MojoSystemTest() override; |
+ |
+ base::TestIOThread* test_io_thread() { return &test_io_thread_; } |
+ |
+ private: |
+ base::MessageLoop message_loop_; |
+ base::TestIOThread test_io_thread_; |
+ test::ScopedIPCSupport ipc_support_; |
+ |
+ MOJO_DISALLOW_COPY_AND_ASSIGN(MojoSystemTest); |
+}; |
+ |
} // namespace test |
-} // namespace system |
+} // namespace edk |
} // namespace mojo |
-#endif // THIRD_PARTY_MOJO_SRC_MOJO_EDK_SYSTEM_TEST_UTILS_H_ |
+#endif // MOJO_EDK_SYSTEM_TEST_UTILS_H_ |