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

Side by Side Diff: net/test/spawned_test_server/local_test_server_win.cc

Issue 74253002: Stop using third_party\python_26 for many tests. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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) 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 LOG(ERROR) << "Could not create JobObject."; 183 LOG(ERROR) << "Could not create JobObject.";
184 return false; 184 return false;
185 } 185 }
186 186
187 if (!base::SetJobObjectLimitFlags(job_handle_.Get(), 187 if (!base::SetJobObjectLimitFlags(job_handle_.Get(),
188 JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE)) { 188 JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE)) {
189 LOG(ERROR) << "Could not SetJobObjectLimitFlags."; 189 LOG(ERROR) << "Could not SetJobObjectLimitFlags.";
190 return false; 190 return false;
191 } 191 }
192 192
193 // Add our internal python to the path so it can be used if there is
194 // no system python.
195 base::FilePath python_dir;
196 if (!PathService::Get(base::DIR_SOURCE_ROOT, &python_dir)) {
197 LOG(ERROR) << "Could not locate source root directory.";
198 return false;
199 }
200 python_dir = python_dir.AppendASCII("third_party").AppendASCII("python_26");
201 ScopedPath python_path(python_dir);
Paweł Hajdan Jr. 2013/11/15 19:34:44 Yay, looks like now we no longer need ScopedPath.
202 base::LaunchOptions launch_options; 193 base::LaunchOptions launch_options;
203 launch_options.inherit_handles = true; 194 launch_options.inherit_handles = true;
204 launch_options.job_handle = job_handle_.Get(); 195 launch_options.job_handle = job_handle_.Get();
205 if (!base::LaunchProcess(python_command, launch_options, &process_handle_)) { 196 if (!base::LaunchProcess(python_command, launch_options, &process_handle_)) {
206 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString(); 197 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString();
207 return false; 198 return false;
208 } 199 }
209 200
210 return true; 201 return true;
211 } 202 }
(...skipping 19 matching lines...) Expand all
231 if (!ParseServerData(server_data)) { 222 if (!ParseServerData(server_data)) {
232 LOG(ERROR) << "Could not parse server_data: " << server_data; 223 LOG(ERROR) << "Could not parse server_data: " << server_data;
233 return false; 224 return false;
234 } 225 }
235 226
236 return true; 227 return true;
237 } 228 }
238 229
239 } // namespace net 230 } // namespace net
240 231
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698