| 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 #include "mojo/edk/test/multiprocess_test_helper.h" | 5 #include "mojo/edk/test/multiprocess_test_helper.h" |
| 6 | 6 |
| 7 #include <functional> | 7 #include <functional> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 ChildProcessLaunched(test_child_.Handle(), channel.PassServerHandle()); | 125 ChildProcessLaunched(test_child_.Handle(), channel.PassServerHandle()); |
| 126 CHECK(test_child_.IsValid()); | 126 CHECK(test_child_.IsValid()); |
| 127 | 127 |
| 128 return pipe; | 128 return pipe; |
| 129 } | 129 } |
| 130 | 130 |
| 131 int MultiprocessTestHelper::WaitForChildShutdown() { | 131 int MultiprocessTestHelper::WaitForChildShutdown() { |
| 132 CHECK(test_child_.IsValid()); | 132 CHECK(test_child_.IsValid()); |
| 133 | 133 |
| 134 int rv = -1; | 134 int rv = -1; |
| 135 #if defined(OS_ANDROID) |
| 136 // On Android, we need to use a special function to wait for the child. |
| 137 CHECK(AndroidWaitForChildExitWithTimeout( |
| 138 test_child_, TestTimeouts::action_timeout(), &rv)); |
| 139 #else |
| 135 CHECK( | 140 CHECK( |
| 136 test_child_.WaitForExitWithTimeout(TestTimeouts::action_timeout(), &rv)); | 141 test_child_.WaitForExitWithTimeout(TestTimeouts::action_timeout(), &rv)); |
| 142 #endif |
| 137 test_child_.Close(); | 143 test_child_.Close(); |
| 138 return rv; | 144 return rv; |
| 139 } | 145 } |
| 140 | 146 |
| 141 bool MultiprocessTestHelper::WaitForChildTestShutdown() { | 147 bool MultiprocessTestHelper::WaitForChildTestShutdown() { |
| 142 return WaitForChildShutdown() == 0; | 148 return WaitForChildShutdown() == 0; |
| 143 } | 149 } |
| 144 | 150 |
| 145 // static | 151 // static |
| 146 void MultiprocessTestHelper::ChildSetup() { | 152 void MultiprocessTestHelper::ChildSetup() { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 176 ::testing::Test::HasNonfatalFailure()) ? 1 : 0; | 182 ::testing::Test::HasNonfatalFailure()) ? 1 : 0; |
| 177 }); | 183 }); |
| 178 } | 184 } |
| 179 | 185 |
| 180 // static | 186 // static |
| 181 std::string MultiprocessTestHelper::primordial_pipe_token; | 187 std::string MultiprocessTestHelper::primordial_pipe_token; |
| 182 | 188 |
| 183 } // namespace test | 189 } // namespace test |
| 184 } // namespace edk | 190 } // namespace edk |
| 185 } // namespace mojo | 191 } // namespace mojo |
| OLD | NEW |