summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui/ui_test_suite.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/ui/ui_test_suite.cc')
-rw-r--r--chrome/test/ui/ui_test_suite.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/test/ui/ui_test_suite.cc b/chrome/test/ui/ui_test_suite.cc
index e0967c4..5a5e07f 100644
--- a/chrome/test/ui/ui_test_suite.cc
+++ b/chrome/test/ui/ui_test_suite.cc
@@ -32,6 +32,7 @@ void UITestSuite::Shutdown() {
#if defined(OS_WIN)
if (crash_service_)
base::KillProcess(crash_service_, 0, false);
+ job_handle_.Close();
#endif
ChromeTestSuite::Shutdown();
}
@@ -45,6 +46,21 @@ void UITestSuite::LoadCrashService() {
if (base::GetProcessCount(L"crash_service.exe", NULL))
return;
+ job_handle_.Set(CreateJobObject(NULL, NULL));
+ if (!job_handle_.IsValid()) {
+ LOG(ERROR) << "Could not create JobObject.";
+ return;
+ }
+
+ JOBOBJECT_EXTENDED_LIMIT_INFORMATION limit_info = {0};
+ limit_info.BasicLimitInformation.LimitFlags =
+ JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
+ if (0 == SetInformationJobObject(job_handle_.Get(),
+ JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info))) {
+ LOG(ERROR) << "Could not SetInformationJobObject.";
+ return;
+ }
+
FilePath exe_dir;
if (!PathService::Get(base::DIR_EXE, &exe_dir)) {
LOG(ERROR) << "Failed to get path to DIR_EXE, "
@@ -52,6 +68,8 @@ void UITestSuite::LoadCrashService() {
return;
}
+ base::LaunchOptions launch_options;
+ launch_options.job_handle = job_handle_.Get();
FilePath crash_service = exe_dir.Append(L"crash_service.exe");
if (!base::LaunchProcess(crash_service.value(), base::LaunchOptions(),
&crash_service_)) {