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

Unified Diff: base/process/process_util_unittest.cc

Issue 759903002: Upgrade the windows specific version of LaunchProcess to avoid raw handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chrome build Created 6 years 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/process/launch_win.cc ('k') | chrome/browser/extensions/api/messaging/native_message_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_util_unittest.cc
diff --git a/base/process/process_util_unittest.cc b/base/process/process_util_unittest.cc
index c98884debcab328fb22ccddd6979198814cdde59..af88fe1fd3a01f2ce3c10427e77b26645ba6eda8 100644
--- a/base/process/process_util_unittest.cc
+++ b/base/process/process_util_unittest.cc
@@ -888,14 +888,14 @@ bool IsProcessDead(base::ProcessHandle child) {
}
TEST_F(ProcessUtilTest, DelayedTermination) {
- base::ProcessHandle child_process = SpawnChild("process_util_test_never_die");
- ASSERT_TRUE(child_process);
- base::EnsureProcessTerminated(child_process);
- base::WaitForSingleProcess(child_process, base::TimeDelta::FromSeconds(5));
+ base::Process child_process(SpawnChild("process_util_test_never_die"));
+ ASSERT_TRUE(child_process.IsValid());
+ base::EnsureProcessTerminated(child_process.Duplicate());
+ base::WaitForSingleProcess(child_process.Handle(),
+ base::TimeDelta::FromSeconds(5));
// Check that process was really killed.
- EXPECT_TRUE(IsProcessDead(child_process));
- base::CloseProcessHandle(child_process);
+ EXPECT_TRUE(IsProcessDead(child_process.Handle()));
}
MULTIPROCESS_TEST_MAIN(process_util_test_never_die) {
@@ -906,16 +906,14 @@ MULTIPROCESS_TEST_MAIN(process_util_test_never_die) {
}
TEST_F(ProcessUtilTest, ImmediateTermination) {
- base::ProcessHandle child_process =
- SpawnChild("process_util_test_die_immediately");
- ASSERT_TRUE(child_process);
+ base::Process child_process(SpawnChild("process_util_test_die_immediately"));
+ ASSERT_TRUE(child_process.IsValid());
// Give it time to die.
sleep(2);
- base::EnsureProcessTerminated(child_process);
+ base::EnsureProcessTerminated(child_process.Duplicate());
// Check that process was really killed.
- EXPECT_TRUE(IsProcessDead(child_process));
- base::CloseProcessHandle(child_process);
+ EXPECT_TRUE(IsProcessDead(child_process.Handle()));
}
MULTIPROCESS_TEST_MAIN(process_util_test_die_immediately) {
« no previous file with comments | « base/process/launch_win.cc ('k') | chrome/browser/extensions/api/messaging/native_message_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698