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

Unified Diff: base/process_util_unittest.cc

Issue 1315009: Make DidProcessCrash a bit more solid and accurate on Windows (Closed)
Patch Set: now with a test Created 10 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/process_util.h ('k') | base/process_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_unittest.cc
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 296aaa964b664c0cc9d2ba75dd7c25aa72d3e363..b4d9b9fcc67dbfed4afaa82d6cefb34b3c872729 100644
--- a/base/process_util_unittest.cc
+++ b/base/process_util_unittest.cc
@@ -78,6 +78,24 @@ TEST_F(ProcessUtilTest, KillSlowChild) {
base::CloseProcessHandle(handle);
}
+TEST_F(ProcessUtilTest, DidProcessCrash) {
+ remove("SlowChildProcess.die");
+ ProcessHandle handle = this->SpawnChild(L"SlowChildProcess");
+ ASSERT_NE(base::kNullProcessHandle, handle);
+
+ bool child_exited = true;
+ EXPECT_FALSE(base::DidProcessCrash(&child_exited, handle));
+ EXPECT_FALSE(child_exited);
+
+ FILE *fp = fopen("SlowChildProcess.die", "w");
+ fclose(fp);
+ EXPECT_TRUE(base::WaitForSingleProcess(handle, 5000));
+
+ EXPECT_FALSE(base::DidProcessCrash(&child_exited, handle));
+
+ base::CloseProcessHandle(handle);
+}
+
// Ensure that the priority of a process is restored correctly after
// backgrounding and restoring.
// Note: a platform may not be willing or able to lower the priority of
« no previous file with comments | « base/process_util.h ('k') | base/process_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698