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

Side by Side Diff: chrome/test/ui/ui_test_suite.cc

Issue 23480061: GTTF: launch test processes using job objects on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/ui/ui_test_suite.h" 5 #include "chrome/test/ui/ui_test_suite.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 if (base::GetProcessCount(L"crash_service.exe", NULL)) 48 if (base::GetProcessCount(L"crash_service.exe", NULL))
49 return; 49 return;
50 50
51 job_handle_.Set(CreateJobObject(NULL, NULL)); 51 job_handle_.Set(CreateJobObject(NULL, NULL));
52 if (!job_handle_.IsValid()) { 52 if (!job_handle_.IsValid()) {
53 LOG(ERROR) << "Could not create JobObject."; 53 LOG(ERROR) << "Could not create JobObject.";
54 return; 54 return;
55 } 55 }
56 56
57 if (!base::SetJobObjectAsKillOnJobClose(job_handle_.Get())) { 57 if (!base::SetJobObjectLimitFlags(job_handle_.Get(),
58 LOG(ERROR) << "Could not SetInformationJobObject."; 58 JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE)) {
59 LOG(ERROR) << "Could not SetJobObjectLimitFlags.";
59 return; 60 return;
60 } 61 }
61 62
62 base::FilePath exe_dir; 63 base::FilePath exe_dir;
63 if (!PathService::Get(base::DIR_EXE, &exe_dir)) { 64 if (!PathService::Get(base::DIR_EXE, &exe_dir)) {
64 LOG(ERROR) << "Failed to get path to DIR_EXE, " 65 LOG(ERROR) << "Failed to get path to DIR_EXE, "
65 << "not starting crash_service.exe!"; 66 << "not starting crash_service.exe!";
66 return; 67 return;
67 } 68 }
68 69
69 base::LaunchOptions launch_options; 70 base::LaunchOptions launch_options;
70 launch_options.job_handle = job_handle_.Get(); 71 launch_options.job_handle = job_handle_.Get();
71 base::FilePath crash_service = exe_dir.Append(L"crash_service.exe"); 72 base::FilePath crash_service = exe_dir.Append(L"crash_service.exe");
72 if (!base::LaunchProcess(crash_service.value(), base::LaunchOptions(), 73 if (!base::LaunchProcess(crash_service.value(), base::LaunchOptions(),
73 &crash_service_)) { 74 &crash_service_)) {
74 LOG(ERROR) << "Couldn't start crash_service.exe, so this ui_tests run " 75 LOG(ERROR) << "Couldn't start crash_service.exe, so this ui_tests run "
75 << "won't tell you if any test crashes!"; 76 << "won't tell you if any test crashes!";
76 return; 77 return;
77 } 78 }
78 } 79 }
79 #endif 80 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698