diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 18:41:25 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 18:41:25 +0000 |
commit | 999520d813ea580a52e22e71670f8b343f5c2845 (patch) | |
tree | 125a875ed1b3de385e6c88d9dbf044464aed6ebd /net | |
parent | 92f094bcb524f053d31d4f026be1453cb9188a60 (diff) | |
download | chromium_src-999520d813ea580a52e22e71670f8b343f5c2845.zip chromium_src-999520d813ea580a52e22e71670f8b343f5c2845.tar.gz chromium_src-999520d813ea580a52e22e71670f8b343f5c2845.tar.bz2 |
Don't require tlslite to be installed, just use what's in the tree
Review URL: http://codereview.chromium.org/13745
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6794 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/url_request/url_request_unittest.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h index 786f40a..a657097 100644 --- a/net/url_request/url_request_unittest.h +++ b/net/url_request/url_request_unittest.h @@ -5,9 +5,12 @@ #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ +#include <stdlib.h> + #include <sstream> #include <string> +#include "base/file_path.h" #include "base/file_util.h" #include "base/message_loop.h" #include "base/path_service.h" @@ -306,9 +309,25 @@ class TestServer : public base::ProcessFilter { base::LaunchApp(command_line, false, true, &process_handle_)) << "Failed to launch " << command_line; #elif defined(OS_POSIX) - bool tlslite_installed = !access("/usr/bin/tls.py", X_OK) || - !access("/usr/local/bin/tls.py", X_OK); - ASSERT_TRUE(tlslite_installed) << "tlslite not installed? Please run 'python setup.py install' in third_party/tlslite."; + // Set up PYTHONPATH so that Python is able to find the in-tree copy of + // tlslite. + + FilePath tlslite_path; + ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &tlslite_path)); + tlslite_path = tlslite_path.Append("third_party"); + tlslite_path = tlslite_path.Append("tlslite"); + + const char kPythonPath[] = "PYTHONPATH"; + char* python_path_c = getenv(kPythonPath); + if (python_path_c) { + // PYTHONPATH is already set, append to it. + std::string python_path(python_path_c); + python_path.append(":"); + python_path.append(tlslite_path.value()); + setenv(kPythonPath, python_path.c_str(), 1); + } else { + setenv(kPythonPath, tlslite_path.value().c_str(), 1); + } std::vector<std::string> command_line; command_line.push_back("python"); @@ -331,7 +350,7 @@ class TestServer : public base::ProcessFilter { retries--; PlatformThread::Sleep(500); } - ASSERT_TRUE(success) << "Webserver not starting properly. (On Linux, you need to install third_party/tlslite.)"; + ASSERT_TRUE(success) << "Webserver not starting properly."; init_successful_ = true; is_shutdown_ = false; |