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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 | 176 |
177 CHECK(test_child_.IsValid()); | 177 CHECK(test_child_.IsValid()); |
178 return pipe; | 178 return pipe; |
179 } | 179 } |
180 | 180 |
181 int MultiprocessTestHelper::WaitForChildShutdown() { | 181 int MultiprocessTestHelper::WaitForChildShutdown() { |
182 CHECK(test_child_.IsValid()); | 182 CHECK(test_child_.IsValid()); |
183 | 183 |
184 int rv = -1; | 184 int rv = -1; |
185 WaitForMultiprocessTestChildExit(test_child_, TestTimeouts::action_timeout(), | 185 #if defined(OS_ANDROID) |
186 &rv); | 186 // On Android, we need to use a special function to wait for the child. |
| 187 CHECK(AndroidWaitForChildExitWithTimeout( |
| 188 test_child_, TestTimeouts::action_timeout(), &rv)); |
| 189 #else |
| 190 CHECK( |
| 191 test_child_.WaitForExitWithTimeout(TestTimeouts::action_timeout(), &rv)); |
| 192 #endif |
187 test_child_.Close(); | 193 test_child_.Close(); |
188 return rv; | 194 return rv; |
189 } | 195 } |
190 | 196 |
191 void MultiprocessTestHelper::ClosePeerConnection() { | 197 void MultiprocessTestHelper::ClosePeerConnection() { |
192 DCHECK(!peer_token_.empty()); | 198 DCHECK(!peer_token_.empty()); |
193 ::mojo::edk::ClosePeerConnection(peer_token_); | 199 ::mojo::edk::ClosePeerConnection(peer_token_); |
194 peer_token_.clear(); | 200 peer_token_.clear(); |
195 } | 201 } |
196 | 202 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 ::testing::Test::HasNonfatalFailure()) ? 1 : 0; | 254 ::testing::Test::HasNonfatalFailure()) ? 1 : 0; |
249 }); | 255 }); |
250 } | 256 } |
251 | 257 |
252 // static | 258 // static |
253 mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe; | 259 mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe; |
254 | 260 |
255 } // namespace test | 261 } // namespace test |
256 } // namespace edk | 262 } // namespace edk |
257 } // namespace mojo | 263 } // namespace mojo |
OLD | NEW |