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

Unified Diff: base/process/process_util_unittest.cc

Issue 780653003: Revert of Upgrade the windows specific version of LaunchProcess to avoid raw handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 af88fe1fd3a01f2ce3c10427e77b26645ba6eda8..c98884debcab328fb22ccddd6979198814cdde59 100644
--- a/base/process/process_util_unittest.cc
+++ b/base/process/process_util_unittest.cc
@@ -888,14 +888,14 @@
}
TEST_F(ProcessUtilTest, DelayedTermination) {
- 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));
+ 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));
// Check that process was really killed.
- EXPECT_TRUE(IsProcessDead(child_process.Handle()));
+ EXPECT_TRUE(IsProcessDead(child_process));
+ base::CloseProcessHandle(child_process);
}
MULTIPROCESS_TEST_MAIN(process_util_test_never_die) {
@@ -906,14 +906,16 @@
}
TEST_F(ProcessUtilTest, ImmediateTermination) {
- base::Process child_process(SpawnChild("process_util_test_die_immediately"));
- ASSERT_TRUE(child_process.IsValid());
+ base::ProcessHandle child_process =
+ SpawnChild("process_util_test_die_immediately");
+ ASSERT_TRUE(child_process);
// Give it time to die.
sleep(2);
- base::EnsureProcessTerminated(child_process.Duplicate());
+ base::EnsureProcessTerminated(child_process);
// Check that process was really killed.
- EXPECT_TRUE(IsProcessDead(child_process.Handle()));
+ EXPECT_TRUE(IsProcessDead(child_process));
+ base::CloseProcessHandle(child_process);
}
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