| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ | 5 #ifndef MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ |
| 6 #define MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ | 6 #define MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class MultiprocessTestHelper { | 26 class MultiprocessTestHelper { |
| 27 public: | 27 public: |
| 28 using HandlerCallback = base::Callback<void(ScopedMessagePipeHandle)>; | 28 using HandlerCallback = base::Callback<void(ScopedMessagePipeHandle)>; |
| 29 | 29 |
| 30 enum class LaunchType { | 30 enum class LaunchType { |
| 31 // Launch the child process as a child in the mojo system. | 31 // Launch the child process as a child in the mojo system. |
| 32 CHILD, | 32 CHILD, |
| 33 | 33 |
| 34 // Launch the child process as an unrelated peer process in the mojo system. | 34 // Launch the child process as an unrelated peer process in the mojo system. |
| 35 PEER, | 35 PEER, |
| 36 |
| 37 // Launch the child process as a child in the mojo system, using a named |
| 38 // pipe. |
| 39 NAMED_CHILD, |
| 40 |
| 41 // Launch the child process as an unrelated peer process in the mojo |
| 42 // system, using a named pipe. |
| 43 NAMED_PEER, |
| 36 }; | 44 }; |
| 37 | 45 |
| 38 MultiprocessTestHelper(); | 46 MultiprocessTestHelper(); |
| 39 ~MultiprocessTestHelper(); | 47 ~MultiprocessTestHelper(); |
| 40 | 48 |
| 41 // Start a child process and run the "main" function "named" |test_child_name| | 49 // Start a child process and run the "main" function "named" |test_child_name| |
| 42 // declared using |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| or | 50 // declared using |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| or |
| 43 // |MOJO_MULTIPROCESS_TEST_CHILD_TEST()| (below). | 51 // |MOJO_MULTIPROCESS_TEST_CHILD_TEST()| (below). |
| 44 ScopedMessagePipeHandle StartChild( | 52 ScopedMessagePipeHandle StartChild( |
| 45 const std::string& test_child_name, | 53 const std::string& test_child_name, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 ProcessErrorCallback process_error_callback_; | 97 ProcessErrorCallback process_error_callback_; |
| 90 | 98 |
| 91 DISALLOW_COPY_AND_ASSIGN(MultiprocessTestHelper); | 99 DISALLOW_COPY_AND_ASSIGN(MultiprocessTestHelper); |
| 92 }; | 100 }; |
| 93 | 101 |
| 94 } // namespace test | 102 } // namespace test |
| 95 } // namespace edk | 103 } // namespace edk |
| 96 } // namespace mojo | 104 } // namespace mojo |
| 97 | 105 |
| 98 #endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ | 106 #endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ |
| OLD | NEW |