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

Side by Side Diff: net/test/spawned_test_server/local_test_server_win.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
« base/test/test_launcher.cc ('K') | « chrome/test/ui/ui_test_suite.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/test/spawned_test_server/local_test_server.h" 5 #include "net/test/spawned_test_server/local_test_server.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <wincrypt.h> 8 #include <wincrypt.h>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // 64-bit)." 122 // 64-bit)."
123 python_command.AppendArg("--startup-pipe=" + 123 python_command.AppendArg("--startup-pipe=" +
124 base::IntToString(reinterpret_cast<uintptr_t>(child_write))); 124 base::IntToString(reinterpret_cast<uintptr_t>(child_write)));
125 125
126 job_handle_.Set(CreateJobObject(NULL, NULL)); 126 job_handle_.Set(CreateJobObject(NULL, NULL));
127 if (!job_handle_.IsValid()) { 127 if (!job_handle_.IsValid()) {
128 LOG(ERROR) << "Could not create JobObject."; 128 LOG(ERROR) << "Could not create JobObject.";
129 return false; 129 return false;
130 } 130 }
131 131
132 if (!base::SetJobObjectAsKillOnJobClose(job_handle_.Get())) { 132 if (!base::SetJobObjectLimitFlags(job_handle_.Get(),
133 LOG(ERROR) << "Could not SetInformationJobObject."; 133 JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE)) {
134 LOG(ERROR) << "Could not SetJobObjectLimitFlags.";
134 return false; 135 return false;
135 } 136 }
136 137
137 base::LaunchOptions launch_options; 138 base::LaunchOptions launch_options;
138 launch_options.inherit_handles = true; 139 launch_options.inherit_handles = true;
139 launch_options.job_handle = job_handle_.Get(); 140 launch_options.job_handle = job_handle_.Get();
140 if (!base::LaunchProcess(python_command, launch_options, &process_handle_)) { 141 if (!base::LaunchProcess(python_command, launch_options, &process_handle_)) {
141 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString(); 142 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString();
142 return false; 143 return false;
143 } 144 }
(...skipping 22 matching lines...) Expand all
166 if (!ParseServerData(server_data)) { 167 if (!ParseServerData(server_data)) {
167 LOG(ERROR) << "Could not parse server_data: " << server_data; 168 LOG(ERROR) << "Could not parse server_data: " << server_data;
168 return false; 169 return false;
169 } 170 }
170 171
171 return true; 172 return true;
172 } 173 }
173 174
174 } // namespace net 175 } // namespace net
175 176
OLDNEW
« base/test/test_launcher.cc ('K') | « chrome/test/ui/ui_test_suite.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698