summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_posix_unittest.cc
diff options
context:
space:
mode:
authorrvargas <rvargas@chromium.org>2015-01-12 14:23:23 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-12 22:25:04 +0000
commit07b589c1f6c4d0aac24e270a13fa83031bf2038c (patch)
tree18a5284042b77bb6845194277e8dea006576b636 /ipc/ipc_channel_posix_unittest.cc
parentd44cce5915db087d726ed2e141896401edeb09b7 (diff)
downloadchromium_src-07b589c1f6c4d0aac24e270a13fa83031bf2038c.zip
chromium_src-07b589c1f6c4d0aac24e270a13fa83031bf2038c.tar.gz
chromium_src-07b589c1f6c4d0aac24e270a13fa83031bf2038c.tar.bz2
MultiProcessTest: Update SpawnChild* to return a Process.
We should not be dealing with raw handles. BUG=417532 Review URL: https://codereview.chromium.org/843113003 Cr-Commit-Position: refs/heads/master@{#311127}
Diffstat (limited to 'ipc/ipc_channel_posix_unittest.cc')
-rw-r--r--ipc/ipc_channel_posix_unittest.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc
index a01710c..93fc13c 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());