summaryrefslogtreecommitdiffstats
path: root/base/process_util_unittest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 13:03:47 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 13:03:47 +0000
commite80bea9a23243ddf8f58c0358df8118159800b53 (patch)
tree43f7da3680f9b6045df619184d629e7347ca3c75 /base/process_util_unittest.cc
parent9bf97140e3fb566cda9436a5f2ba33df01f21d6d (diff)
downloadchromium_src-e80bea9a23243ddf8f58c0358df8118159800b53.zip
chromium_src-e80bea9a23243ddf8f58c0358df8118159800b53.tar.gz
chromium_src-e80bea9a23243ddf8f58c0358df8118159800b53.tar.bz2
Make DidProcessCrash a bit more solid and accurate on Windows
I hit the NOTREACHED() inside it while debugging an unrelated problem. Also, now there is one less special case in this function's contract. TEST=none BUG=38048 Review URL: http://codereview.chromium.org/1315009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43706 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r--base/process_util_unittest.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 296aaa9..b4d9b9f 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