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

Unified Diff: mojo/edk/system/test_utils.h

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 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: 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 71%
copy from third_party/mojo/src/mojo/edk/system/test_utils.h
copy to mojo/edk/system/test_utils.h
index 144e07bf0448ec175d25c796b174516c609b7cd7..505fcc5dbeb6379379132e2b8f54d7ff6bfdf82b 100644
--- a/third_party/mojo/src/mojo/edk/system/test_utils.h
+++ b/mojo/edk/system/test_utils.h
@@ -5,12 +5,15 @@
#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);
@@ -25,7 +28,7 @@ MojoDeadline EpsilonDeadline();
// the order of 100 ms.)
MojoDeadline TinyDeadline();
-// |TestTimeouts::action_timeout()|, as a |MojoDeadline|. (Expect this to be on
+// |TestTimeouts::action_timeout()|, as a |MojoDeadline|.(Expect this to be on
// the order of 10 s.)
MojoDeadline ActionDeadline();
@@ -51,8 +54,23 @@ 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;
+
+ 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 // MOJO_EDK_SYSTEM_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698