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

Unified Diff: base/mac/mach_port_broker_unittest.cc

Issue 2733323002: Changing multiprocess test SpawnChild to return a struct. (Closed)
Patch Set: Synced Created 3 years, 9 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 | « base/files/file_locking_unittest.cc ('k') | base/memory/shared_memory_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/mach_port_broker_unittest.cc
diff --git a/base/mac/mach_port_broker_unittest.cc b/base/mac/mach_port_broker_unittest.cc
index bff8eb6a9bc946d9e46e04c007b7d8d52fbc66c2..cb4b82ca47ccf1eb83463f221d4c3b552918e9ef 100644
--- a/base/mac/mach_port_broker_unittest.cc
+++ b/base/mac/mach_port_broker_unittest.cc
@@ -95,21 +95,21 @@ TEST_F(MachPortBrokerTest, ReceivePortFromChild) {
CommandLine command_line(
base::GetMultiProcessTestChildBaseCommandLine());
broker_.GetLock().Acquire();
- base::Process test_child_process = base::SpawnMultiProcessTestChild(
+ base::SpawnChildResult spawn_result = base::SpawnMultiProcessTestChild(
"MachPortBrokerTestChild", command_line, LaunchOptions());
- broker_.AddPlaceholderForPid(test_child_process.Handle());
+ broker_.AddPlaceholderForPid(spawn_result.process.Handle());
broker_.GetLock().Release();
WaitForTaskPort();
- EXPECT_EQ(test_child_process.Handle(), received_process_);
+ EXPECT_EQ(spawn_result.process.Handle(), received_process_);
int rv = -1;
- ASSERT_TRUE(test_child_process.WaitForExitWithTimeout(
+ ASSERT_TRUE(spawn_result.process.WaitForExitWithTimeout(
TestTimeouts::action_timeout(), &rv));
EXPECT_EQ(0, rv);
EXPECT_NE(static_cast<mach_port_t>(MACH_PORT_NULL),
- broker_.TaskForPid(test_child_process.Handle()));
+ broker_.TaskForPid(spawn_result.process.Handle()));
}
TEST_F(MachPortBrokerTest, ReceivePortFromChildWithoutAdding) {
@@ -117,17 +117,18 @@ TEST_F(MachPortBrokerTest, ReceivePortFromChildWithoutAdding) {
CommandLine command_line(
base::GetMultiProcessTestChildBaseCommandLine());
broker_.GetLock().Acquire();
- base::Process test_child_process = base::SpawnMultiProcessTestChild(
+ base::SpawnChildResult spawn_result = base::SpawnMultiProcessTestChild(
"MachPortBrokerTestChild", command_line, LaunchOptions());
+
broker_.GetLock().Release();
int rv = -1;
- ASSERT_TRUE(test_child_process.WaitForExitWithTimeout(
+ ASSERT_TRUE(spawn_result.process.WaitForExitWithTimeout(
TestTimeouts::action_timeout(), &rv));
EXPECT_EQ(0, rv);
EXPECT_EQ(static_cast<mach_port_t>(MACH_PORT_NULL),
- broker_.TaskForPid(test_child_process.Handle()));
+ broker_.TaskForPid(spawn_result.process.Handle()));
}
} // namespace base
« no previous file with comments | « base/files/file_locking_unittest.cc ('k') | base/memory/shared_memory_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698