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

Unified Diff: mojo/edk/test/multiprocess_test_helper.cc

Issue 843113003: MultiProcessTest: Update SpawnChild* to return a Process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/test/multiprocess_test_helper.h ('k') | sandbox/mac/bootstrap_sandbox_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/test/multiprocess_test_helper.cc
diff --git a/mojo/edk/test/multiprocess_test_helper.cc b/mojo/edk/test/multiprocess_test_helper.cc
index 758520a68157ce4640036848a12e68984a9dbe40..7f44d82c647ea51d7103f0646b95bfbbf8355d50 100644
--- a/mojo/edk/test/multiprocess_test_helper.cc
+++ b/mojo/edk/test/multiprocess_test_helper.cc
@@ -14,14 +14,13 @@
namespace mojo {
namespace test {
-MultiprocessTestHelper::MultiprocessTestHelper()
- : test_child_handle_(base::kNullProcessHandle) {
+MultiprocessTestHelper::MultiprocessTestHelper() {
platform_channel_pair_.reset(new embedder::PlatformChannelPair());
server_platform_handle = platform_channel_pair_->PassServerHandle();
}
MultiprocessTestHelper::~MultiprocessTestHelper() {
- CHECK_EQ(test_child_handle_, base::kNullProcessHandle);
+ CHECK(!test_child_.IsValid());
server_platform_handle.reset();
platform_channel_pair_.reset();
}
@@ -29,7 +28,7 @@ MultiprocessTestHelper::~MultiprocessTestHelper() {
void MultiprocessTestHelper::StartChild(const std::string& test_child_name) {
CHECK(platform_channel_pair_);
CHECK(!test_child_name.empty());
- CHECK_EQ(test_child_handle_, base::kNullProcessHandle);
+ CHECK(!test_child_.IsValid());
std::string test_child_main = test_child_name + "TestChildMain";
@@ -49,21 +48,20 @@ void MultiprocessTestHelper::StartChild(const std::string& test_child_name) {
#error "Not supported yet."
#endif
- test_child_handle_ =
+ test_child_ =
base::SpawnMultiProcessTestChild(test_child_main, command_line, options);
platform_channel_pair_->ChildProcessLaunched();
- CHECK_NE(test_child_handle_, base::kNullProcessHandle);
+ CHECK(test_child_.IsValid());
}
int MultiprocessTestHelper::WaitForChildShutdown() {
- CHECK_NE(test_child_handle_, base::kNullProcessHandle);
+ CHECK(test_child_.IsValid());
int rv = -1;
- CHECK(base::WaitForExitCodeWithTimeout(test_child_handle_, &rv,
- TestTimeouts::action_timeout()));
- base::CloseProcessHandle(test_child_handle_);
- test_child_handle_ = base::kNullProcessHandle;
+ CHECK(test_child_.WaitForExitWithTimeout(TestTimeouts::action_timeout(),
+ &rv));
+ test_child_.Close();
return rv;
}
« no previous file with comments | « mojo/edk/test/multiprocess_test_helper.h ('k') | sandbox/mac/bootstrap_sandbox_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698