diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-05 17:50:12 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-05 17:50:12 +0000 |
commit | b69732138efc274c1d61925629231eb9036aa811 (patch) | |
tree | 8c3db9b9950e1beb89c355358864bf422c0552fe /net/test | |
parent | d3be17b7a048df86d4ec5ff845dc730abf976114 (diff) | |
download | chromium_src-b69732138efc274c1d61925629231eb9036aa811.zip chromium_src-b69732138efc274c1d61925629231eb9036aa811.tar.gz chromium_src-b69732138efc274c1d61925629231eb9036aa811.tar.bz2 |
Stop using third_party\python_26 for many tests.
Migrate testserver.py from using embedded python in third_party\python_26 to
the python version installed on the system.
Kill many python_26 references.
It reduces the amount of data that needs to be transfered for Windows swarm
slaves.
The remaining uses of third_party\python_26 are:
1. chrome_frame.
2. pyauto needs the python SDK. As such, it needs a "known" python installation.
3. gn.
R=phajdan.jr@chromium.org,rsleevi@chromium.org
BUG=98636
BUG=321703
TEST=
Review URL: https://codereview.chromium.org/74253002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238989 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test')
-rw-r--r-- | net/test/python_utils.cc | 8 | ||||
-rw-r--r-- | net/test/spawned_test_server/local_test_server.cc | 8 | ||||
-rw-r--r-- | net/test/spawned_test_server/local_test_server_win.cc | 9 |
3 files changed, 14 insertions, 11 deletions
diff --git a/net/test/python_utils.cc b/net/test/python_utils.cc index bf66bea..e249a27 100644 --- a/net/test/python_utils.cc +++ b/net/test/python_utils.cc @@ -109,8 +109,14 @@ bool GetPyProtoPath(base::FilePath* dir) { bool GetPythonCommand(CommandLine* python_cmd) { DCHECK(python_cmd); +#if defined(OS_WIN) + // This permits finding the proper python in path even if it is a .bat file. + python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("cmd.exe"))); + python_cmd->AppendArg("/c"); + python_cmd->AppendArg("python"); +#else python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("python"))); - +#endif // defined(OS_WIN) // Launch python in unbuffered mode, so that python output doesn't mix with // gtest output in buildbot log files. See http://crbug.com/147368. python_cmd->AppendArg("-u"); diff --git a/net/test/spawned_test_server/local_test_server.cc b/net/test/spawned_test_server/local_test_server.cc index bf1b059..8679d7b 100644 --- a/net/test/spawned_test_server/local_test_server.cc +++ b/net/test/spawned_test_server/local_test_server.cc @@ -124,10 +124,16 @@ bool LocalTestServer::Stop() { if (!process_handle_) return true; +#if defined(OS_WIN) + // This kills all the processes in the job object. + job_handle_.Close(); +#endif + // First check if the process has already terminated. bool ret = base::WaitForSingleProcess(process_handle_, base::TimeDelta()); - if (!ret) + if (!ret) { ret = base::KillProcess(process_handle_, 1, true); + } if (ret) { base::CloseProcessHandle(process_handle_); diff --git a/net/test/spawned_test_server/local_test_server_win.cc b/net/test/spawned_test_server/local_test_server_win.cc index 08d68f8..db06742 100644 --- a/net/test/spawned_test_server/local_test_server_win.cc +++ b/net/test/spawned_test_server/local_test_server_win.cc @@ -190,15 +190,6 @@ bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) { return false; } - // Add our internal python to the path so it can be used if there is - // no system python. - base::FilePath python_dir; - if (!PathService::Get(base::DIR_SOURCE_ROOT, &python_dir)) { - LOG(ERROR) << "Could not locate source root directory."; - return false; - } - python_dir = python_dir.AppendASCII("third_party").AppendASCII("python_26"); - ScopedPath python_path(python_dir); base::LaunchOptions launch_options; launch_options.inherit_handles = true; launch_options.job_handle = job_handle_.Get(); |