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

Unified Diff: ipc/ipc_test_base.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 | « ipc/ipc_test_base.h ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_test_base.cc
diff --git a/ipc/ipc_test_base.cc b/ipc/ipc_test_base.cc
index ba4e71156af50a6e5dc80036ebf689f4d82463c6..17fce0baace389c355d277ef58c82a91d3fa0b43 100644
--- a/ipc/ipc_test_base.cc
+++ b/ipc/ipc_test_base.cc
@@ -22,8 +22,7 @@ std::string IPCTestBase::GetChannelName(const std::string& test_client_name) {
return test_client_name + "__Channel";
}
-IPCTestBase::IPCTestBase()
- : client_process_(base::kNullProcessHandle) {
+IPCTestBase::IPCTestBase() {
}
IPCTestBase::~IPCTestBase() {
@@ -104,8 +103,8 @@ std::string IPCTestBase::GetTestMainName() const {
}
bool IPCTestBase::DidStartClient() {
- DCHECK_NE(base::kNullProcessHandle, client_process_);
- return client_process_ != base::kNullProcessHandle;
+ DCHECK(client_process_.IsValid());
+ return client_process_.IsValid();
}
#if defined(OS_POSIX)
@@ -117,7 +116,7 @@ bool IPCTestBase::StartClient() {
}
bool IPCTestBase::StartClientWithFD(int ipcfd) {
- DCHECK_EQ(client_process_, base::kNullProcessHandle);
+ DCHECK(!client_process_.IsValid());
base::FileHandleMappingVector fds_to_map;
if (ipcfd > -1)
@@ -133,7 +132,7 @@ bool IPCTestBase::StartClientWithFD(int ipcfd) {
#elif defined(OS_WIN)
bool IPCTestBase::StartClient() {
- DCHECK_EQ(client_process_, base::kNullProcessHandle);
+ DCHECK(!client_process_.IsValid());
client_process_ = SpawnChild(GetTestMainName());
return DidStartClient();
}
@@ -141,12 +140,11 @@ bool IPCTestBase::StartClient() {
#endif
bool IPCTestBase::WaitForClientShutdown() {
- DCHECK(client_process_ != base::kNullProcessHandle);
+ DCHECK(client_process_.IsValid());
- bool rv = base::WaitForSingleProcess(client_process_,
+ bool rv = base::WaitForSingleProcess(client_process_.Handle(),
base::TimeDelta::FromSeconds(5));
- base::CloseProcessHandle(client_process_);
- client_process_ = base::kNullProcessHandle;
+ client_process_.Close();
return rv;
}
« no previous file with comments | « ipc/ipc_test_base.h ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698