| 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/process/process.h" | 10 #include "base/process/process.h" |
| 11 #include "base/test/multiprocess_test.h" | 11 #include "base/test/multiprocess_test.h" |
| 12 #include "base/test/test_timeouts.h" | 12 #include "base/test/test_timeouts.h" |
| 13 #include "mojo/edk/embedder/scoped_platform_handle.h" | 13 #include "mojo/edk/embedder/scoped_platform_handle.h" |
| 14 #include "mojo/public/cpp/system/macros.h" | 14 #include "mojo/public/cpp/system/macros.h" |
| 15 #include "testing/multiprocess_func_list.h" | 15 #include "testing/multiprocess_func_list.h" |
| 16 | 16 |
| 17 namespace mojo { | 17 namespace mojo { |
| 18 | 18 |
| 19 namespace edk { | 19 namespace edk { |
| 20 class PlatformChannelPair; | 20 class PlatformChannelPair; |
| 21 | 21 |
| 22 namespace test { | 22 namespace test { |
| 23 | 23 |
| 24 extern const char kBrokerHandleSwitch[]; | 24 extern const char kBrokerHandleSwitch[]; |
| 25 | 25 |
| 26 #if !defined(OS_IOS) |
| 27 |
| 26 class MultiprocessTestHelper { | 28 class MultiprocessTestHelper { |
| 27 public: | 29 public: |
| 28 MultiprocessTestHelper(); | 30 MultiprocessTestHelper(); |
| 29 ~MultiprocessTestHelper(); | 31 ~MultiprocessTestHelper(); |
| 30 | 32 |
| 31 // Start a child process and run the "main" function "named" |test_child_name| | 33 // Start a child process and run the "main" function "named" |test_child_name| |
| 32 // declared using |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| or | 34 // declared using |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| or |
| 33 // |MOJO_MULTIPROCESS_TEST_CHILD_TEST()| (below). | 35 // |MOJO_MULTIPROCESS_TEST_CHILD_TEST()| (below). |
| 34 void StartChild(const std::string& test_child_name); | 36 void StartChild(const std::string& test_child_name); |
| 35 // Like |StartChild()|, but appends an extra switch (with ASCII value) to the | 37 // Like |StartChild()|, but appends an extra switch (with ASCII value) to the |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 void test_child_name##TestChildTest(); \ | 92 void test_child_name##TestChildTest(); \ |
| 91 MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \ | 93 MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \ |
| 92 test_child_name##TestChildTest(); \ | 94 test_child_name##TestChildTest(); \ |
| 93 return (::testing::Test::HasFatalFailure() || \ | 95 return (::testing::Test::HasFatalFailure() || \ |
| 94 ::testing::Test::HasNonfatalFailure()) \ | 96 ::testing::Test::HasNonfatalFailure()) \ |
| 95 ? 1 \ | 97 ? 1 \ |
| 96 : 0; \ | 98 : 0; \ |
| 97 } \ | 99 } \ |
| 98 void test_child_name##TestChildTest() | 100 void test_child_name##TestChildTest() |
| 99 | 101 |
| 102 #endif // !defined(OS_IOS) |
| 103 |
| 100 } // namespace test | 104 } // namespace test |
| 101 } // namespace edk | 105 } // namespace edk |
| 102 } // namespace mojo | 106 } // namespace mojo |
| 103 | 107 |
| 104 #endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ | 108 #endif // MOJO_EDK_TEST_MULTIPROCESS_TEST_HELPER_H_ |
| OLD | NEW |