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

Side by Side Diff: mojo/edk/test/multiprocess_test_helper.cc

Issue 2549363004: Multiprocess test client: Android child process launcher rework. (Closed)
Patch Set: Fixed tests Created 4 years 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 unified diff | Download patch
OLDNEW
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
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 #if defined(OS_ANDROID) 185 WaitForMultiprocessTestChildExit(test_child_, TestTimeouts::action_timeout(),
186 // On Android, we need to use a special function to wait for the child. 186 &rv);
187 CHECK(AndroidWaitForChildExitWithTimeout(
188 test_child_, TestTimeouts::action_timeout(), &rv));
189 #else
190 CHECK(
191 test_child_.WaitForExitWithTimeout(TestTimeouts::action_timeout(), &rv));
192 #endif
193 test_child_.Close(); 187 test_child_.Close();
194 return rv; 188 return rv;
195 } 189 }
196 190
197 void MultiprocessTestHelper::ClosePeerConnection() { 191 void MultiprocessTestHelper::ClosePeerConnection() {
198 DCHECK(!peer_token_.empty()); 192 DCHECK(!peer_token_.empty());
199 ::mojo::edk::ClosePeerConnection(peer_token_); 193 ::mojo::edk::ClosePeerConnection(peer_token_);
200 peer_token_.clear(); 194 peer_token_.clear();
201 } 195 }
202 196
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 ::testing::Test::HasNonfatalFailure()) ? 1 : 0; 248 ::testing::Test::HasNonfatalFailure()) ? 1 : 0;
255 }); 249 });
256 } 250 }
257 251
258 // static 252 // static
259 mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe; 253 mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe;
260 254
261 } // namespace test 255 } // namespace test
262 } // namespace edk 256 } // namespace edk
263 } // namespace mojo 257 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698