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

Unified Diff: ipc/ipc_channel_posix_unittest.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 | « content/common/sandbox_mac_unittest_helper.mm ('k') | ipc/ipc_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix_unittest.cc
diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc
index a01710c5c5c0d186c3911af0f99e89a41468a8a6..93fc13cc0cd2ba4a6674c932cb94e218fb591e20 100644
--- a/ipc/ipc_channel_posix_unittest.cc
+++ b/ipc/ipc_channel_posix_unittest.cc
@@ -293,8 +293,8 @@ TEST_F(IPCChannelPosixTest, AdvancedConnected) {
ASSERT_TRUE(channel->AcceptsConnections());
ASSERT_FALSE(channel->HasAcceptedConnection());
- base::ProcessHandle handle = SpawnChild("IPCChannelPosixTestConnectionProc");
- ASSERT_TRUE(handle);
+ base::Process process = SpawnChild("IPCChannelPosixTestConnectionProc");
+ ASSERT_TRUE(process.IsValid());
SpinRunLoop(TestTimeouts::action_max_timeout());
ASSERT_EQ(IPCChannelPosixTestListener::CONNECTED, listener.status());
ASSERT_TRUE(channel->HasAcceptedConnection());
@@ -304,7 +304,7 @@ TEST_F(IPCChannelPosixTest, AdvancedConnected) {
channel->Send(message);
SpinRunLoop(TestTimeouts::action_timeout());
int exit_code = 0;
- EXPECT_TRUE(base::WaitForExitCode(handle, &exit_code));
+ EXPECT_TRUE(process.WaitForExit(&exit_code));
EXPECT_EQ(0, exit_code);
ASSERT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status());
ASSERT_FALSE(channel->HasAcceptedConnection());
@@ -323,16 +323,16 @@ TEST_F(IPCChannelPosixTest, ResetState) {
ASSERT_TRUE(channel->AcceptsConnections());
ASSERT_FALSE(channel->HasAcceptedConnection());
- base::ProcessHandle handle = SpawnChild("IPCChannelPosixTestConnectionProc");
- ASSERT_TRUE(handle);
+ base::Process process = SpawnChild("IPCChannelPosixTestConnectionProc");
+ ASSERT_TRUE(process.IsValid());
SpinRunLoop(TestTimeouts::action_max_timeout());
ASSERT_EQ(IPCChannelPosixTestListener::CONNECTED, listener.status());
ASSERT_TRUE(channel->HasAcceptedConnection());
channel->ResetToAcceptingConnectionState();
ASSERT_FALSE(channel->HasAcceptedConnection());
- base::ProcessHandle handle2 = SpawnChild("IPCChannelPosixTestConnectionProc");
- ASSERT_TRUE(handle2);
+ base::Process process2 = SpawnChild("IPCChannelPosixTestConnectionProc");
+ ASSERT_TRUE(process2.IsValid());
SpinRunLoop(TestTimeouts::action_max_timeout());
ASSERT_EQ(IPCChannelPosixTestListener::CONNECTED, listener.status());
ASSERT_TRUE(channel->HasAcceptedConnection());
@@ -341,9 +341,9 @@ TEST_F(IPCChannelPosixTest, ResetState) {
IPC::Message::PRIORITY_NORMAL);
channel->Send(message);
SpinRunLoop(TestTimeouts::action_timeout());
- EXPECT_TRUE(base::KillProcess(handle, 0, false));
+ EXPECT_TRUE(base::KillProcess(process.Handle(), 0, false));
int exit_code = 0;
- EXPECT_TRUE(base::WaitForExitCode(handle2, &exit_code));
+ EXPECT_TRUE(process2.WaitForExit(&exit_code));
EXPECT_EQ(0, exit_code);
ASSERT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status());
ASSERT_FALSE(channel->HasAcceptedConnection());
@@ -383,16 +383,16 @@ TEST_F(IPCChannelPosixTest, MultiConnection) {
ASSERT_TRUE(channel->AcceptsConnections());
ASSERT_FALSE(channel->HasAcceptedConnection());
- base::ProcessHandle handle = SpawnChild("IPCChannelPosixTestConnectionProc");
- ASSERT_TRUE(handle);
+ base::Process process = SpawnChild("IPCChannelPosixTestConnectionProc");
+ ASSERT_TRUE(process.IsValid());
SpinRunLoop(TestTimeouts::action_max_timeout());
ASSERT_EQ(IPCChannelPosixTestListener::CONNECTED, listener.status());
ASSERT_TRUE(channel->HasAcceptedConnection());
- base::ProcessHandle handle2 = SpawnChild("IPCChannelPosixFailConnectionProc");
- ASSERT_TRUE(handle2);
+ base::Process process2 = SpawnChild("IPCChannelPosixFailConnectionProc");
+ ASSERT_TRUE(process2.IsValid());
SpinRunLoop(TestTimeouts::action_max_timeout());
int exit_code = 0;
- EXPECT_TRUE(base::WaitForExitCode(handle2, &exit_code));
+ EXPECT_TRUE(process2.WaitForExit(&exit_code));
EXPECT_EQ(exit_code, 0);
ASSERT_EQ(IPCChannelPosixTestListener::DENIED, listener.status());
ASSERT_TRUE(channel->HasAcceptedConnection());
@@ -401,7 +401,7 @@ TEST_F(IPCChannelPosixTest, MultiConnection) {
IPC::Message::PRIORITY_NORMAL);
channel->Send(message);
SpinRunLoop(TestTimeouts::action_timeout());
- EXPECT_TRUE(base::WaitForExitCode(handle, &exit_code));
+ EXPECT_TRUE(process.WaitForExit(&exit_code));
EXPECT_EQ(exit_code, 0);
ASSERT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status());
ASSERT_FALSE(channel->HasAcceptedConnection());
« no previous file with comments | « content/common/sandbox_mac_unittest_helper.mm ('k') | ipc/ipc_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698