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

Unified Diff: chrome/common/process_watcher_unittest.cc

Issue 542042: Mac: ensure child processes are properly reaped -- eliminate Helper zombies. (Closed)
Patch Set: Added test. Created 10 years, 11 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 | « chrome/common/process_watcher_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/process_watcher_unittest.cc
diff --git a/chrome/common/process_watcher_unittest.cc b/chrome/common/process_watcher_unittest.cc
index 505a468770ce927602aedf73d9b9b3ad768db2ee..af4aaa2443c237a97e4ceb72d7871ece6118a483 100644
--- a/chrome/common/process_watcher_unittest.cc
+++ b/chrome/common/process_watcher_unittest.cc
@@ -39,10 +39,26 @@ TEST_F(ProcessWatcherTest, DelayedTermination) {
}
MULTIPROCESS_TEST_MAIN(process_watcher_test_never_die) {
- while(1){
+ while (1) {
sleep(500);
}
return 0;
}
+TEST_F(ProcessWatcherTest, ImmediateTermination) {
+ base::ProcessHandle child_process =
+ SpawnChild(L"process_watcher_test_die_immediately");
+ // Give it time to die.
+ sleep(2);
+ ProcessWatcher::EnsureProcessTerminated(child_process);
+
+ // Check that process was really killed.
+ EXPECT_TRUE(IsProcessDead(child_process));
+ base::CloseProcessHandle(child_process);
+}
+
+MULTIPROCESS_TEST_MAIN(process_watcher_test_die_immediately) {
+ return 0;
+}
+
#endif // OS_POSIX
« no previous file with comments | « chrome/common/process_watcher_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698