Index: base/process/process_unittest.cc |
diff --git a/base/process/process_unittest.cc b/base/process/process_unittest.cc |
index 619d22b5d95007937598948874d31fa109031607..12c1b0d2585d5076aea9c0eb879465c96b3ce4e0 100644 |
--- a/base/process/process_unittest.cc |
+++ b/base/process/process_unittest.cc |
@@ -42,7 +42,8 @@ class ProcessTest : public MultiProcessTest { |
}; |
TEST_F(ProcessTest, Create) { |
- Process process(SpawnChild("SimpleChildProcess")); |
+ SpawnChildResult spawn_result = SpawnChild("SimpleChildProcess"); |
+ Process process(std::move(spawn_result.process)); |
ASSERT_TRUE(process.IsValid()); |
ASSERT_FALSE(process.is_current()); |
process.Close(); |
@@ -58,7 +59,8 @@ TEST_F(ProcessTest, CreateCurrent) { |
} |
TEST_F(ProcessTest, Move) { |
- Process process1(SpawnChild("SimpleChildProcess")); |
+ SpawnChildResult spawn_result = SpawnChild("SimpleChildProcess"); |
+ Process process1(std::move(spawn_result.process)); |
EXPECT_TRUE(process1.IsValid()); |
Process process2; |
@@ -77,7 +79,8 @@ TEST_F(ProcessTest, Move) { |
} |
TEST_F(ProcessTest, Duplicate) { |
- Process process1(SpawnChild("SimpleChildProcess")); |
+ SpawnChildResult spawn_result = SpawnChild("SimpleChildProcess"); |
+ Process process1(std::move(spawn_result.process)); |
ASSERT_TRUE(process1.IsValid()); |
Process process2 = process1.Duplicate(); |
@@ -107,7 +110,8 @@ TEST_F(ProcessTest, DuplicateCurrent) { |
} |
TEST_F(ProcessTest, DeprecatedGetProcessFromHandle) { |
- Process process1(SpawnChild("SimpleChildProcess")); |
+ SpawnChildResult spawn_result = SpawnChild("SimpleChildProcess"); |
+ Process process1(std::move(spawn_result.process)); |
ASSERT_TRUE(process1.IsValid()); |
Process process2 = Process::DeprecatedGetProcessFromHandle(process1.Handle()); |
@@ -127,7 +131,8 @@ MULTIPROCESS_TEST_MAIN(SleepyChildProcess) { |
} |
TEST_F(ProcessTest, Terminate) { |
- Process process(SpawnChild("SleepyChildProcess")); |
+ SpawnChildResult spawn_result = SpawnChild("SleepyChildProcess"); |
+ Process process(std::move(spawn_result.process)); |
ASSERT_TRUE(process.IsValid()); |
const int kDummyExitCode = 42; |
@@ -173,7 +178,9 @@ MULTIPROCESS_TEST_MAIN(TerminateCurrentProcessImmediatelyWithCode0) { |
} |
TEST_F(ProcessTest, TerminateCurrentProcessImmediatelyWithZeroExitCode) { |
- Process process(SpawnChild("TerminateCurrentProcessImmediatelyWithCode0")); |
+ SpawnChildResult spawn_result = |
+ SpawnChild("TerminateCurrentProcessImmediatelyWithCode0"); |
+ Process process(std::move(spawn_result.process)); |
ASSERT_TRUE(process.IsValid()); |
int exit_code = 42; |
ASSERT_TRUE(process.WaitForExitWithTimeout(TestTimeouts::action_max_timeout(), |
@@ -188,7 +195,9 @@ MULTIPROCESS_TEST_MAIN(TerminateCurrentProcessImmediatelyWithCode250) { |
} |
TEST_F(ProcessTest, TerminateCurrentProcessImmediatelyWithNonZeroExitCode) { |
- Process process(SpawnChild("TerminateCurrentProcessImmediatelyWithCode250")); |
+ SpawnChildResult spawn_result = |
+ SpawnChild("TerminateCurrentProcessImmediatelyWithCode250"); |
+ Process process(std::move(spawn_result.process)); |
ASSERT_TRUE(process.IsValid()); |
int exit_code = 42; |
ASSERT_TRUE(process.WaitForExitWithTimeout(TestTimeouts::action_max_timeout(), |
@@ -202,7 +211,8 @@ MULTIPROCESS_TEST_MAIN(FastSleepyChildProcess) { |
} |
TEST_F(ProcessTest, WaitForExit) { |
- Process process(SpawnChild("FastSleepyChildProcess")); |
+ SpawnChildResult spawn_result = SpawnChild("FastSleepyChildProcess"); |
+ Process process(std::move(spawn_result.process)); |
ASSERT_TRUE(process.IsValid()); |
const int kDummyExitCode = 42; |
@@ -212,7 +222,8 @@ TEST_F(ProcessTest, WaitForExit) { |
} |
TEST_F(ProcessTest, WaitForExitWithTimeout) { |
- Process process(SpawnChild("SleepyChildProcess")); |
+ SpawnChildResult spawn_result = SpawnChild("SleepyChildProcess"); |
+ Process process(std::move(spawn_result.process)); |
ASSERT_TRUE(process.IsValid()); |
const int kDummyExitCode = 42; |
@@ -231,7 +242,8 @@ TEST_F(ProcessTest, WaitForExitWithTimeout) { |
TEST_F(ProcessTest, SetProcessBackgrounded) { |
if (!Process::CanBackgroundProcesses()) |
return; |
- Process process(SpawnChild("SimpleChildProcess")); |
+ SpawnChildResult spawn_result = SpawnChild("SimpleChildProcess"); |
+ Process process(std::move(spawn_result.process)); |
int old_priority = process.GetPriority(); |
#if defined(OS_WIN) |
EXPECT_TRUE(process.SetProcessBackgrounded(true)); |