| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 5 #include <string> |
| 6 #include <algorithm> | 6 #include <algorithm> |
| 7 | 7 |
| 8 #include "net/socket/ssl_test_util.h" | 8 #include "net/socket/ssl_test_util.h" |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 { | 101 { |
| 102 PathService::Get(base::DIR_SOURCE_ROOT, &cert_dir_); | 102 PathService::Get(base::DIR_SOURCE_ROOT, &cert_dir_); |
| 103 cert_dir_ = cert_dir_.Append(FILE_PATH_LITERAL("net")) | 103 cert_dir_ = cert_dir_.Append(FILE_PATH_LITERAL("net")) |
| 104 .Append(FILE_PATH_LITERAL("data")) | 104 .Append(FILE_PATH_LITERAL("data")) |
| 105 .Append(FILE_PATH_LITERAL("ssl")) | 105 .Append(FILE_PATH_LITERAL("ssl")) |
| 106 .Append(FILE_PATH_LITERAL("certificates")); | 106 .Append(FILE_PATH_LITERAL("certificates")); |
| 107 } | 107 } |
| 108 | 108 |
| 109 namespace { | 109 namespace { |
| 110 | 110 |
| 111 void AppendToPythonPath(FilePath dir) { | 111 void AppendToPythonPath(const FilePath& dir) { |
| 112 // Do nothing if dir already on path. | 112 // Do nothing if dir already on path. |
| 113 | 113 |
| 114 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
| 115 const wchar_t kPythonPath[] = L"PYTHONPATH"; | 115 const wchar_t kPythonPath[] = L"PYTHONPATH"; |
| 116 // FIXME(dkegel): handle longer PYTHONPATH variables | 116 // FIXME(dkegel): handle longer PYTHONPATH variables |
| 117 wchar_t oldpath[4096]; | 117 wchar_t oldpath[4096]; |
| 118 if (GetEnvironmentVariable(kPythonPath, oldpath, sizeof(oldpath)) == 0) { | 118 if (GetEnvironmentVariable(kPythonPath, oldpath, sizeof(oldpath)) == 0) { |
| 119 SetEnvironmentVariableW(kPythonPath, dir.value().c_str()); | 119 SetEnvironmentVariableW(kPythonPath, dir.value().c_str()); |
| 120 } else if (!wcsstr(oldpath, dir.value().c_str())) { | 120 } else if (!wcsstr(oldpath, dir.value().c_str())) { |
| 121 std::wstring newpath(oldpath); | 121 std::wstring newpath(oldpath); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 "certificate to your trusted roots for this test to work. " | 357 "certificate to your trusted roots for this test to work. " |
| 358 "For more info visit:\n" | 358 "For more info visit:\n" |
| 359 "http://dev.chromium.org/developers/testing\n"; | 359 "http://dev.chromium.org/developers/testing\n"; |
| 360 return false; | 360 return false; |
| 361 } | 361 } |
| 362 #endif | 362 #endif |
| 363 return true; | 363 return true; |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace net | 366 } // namespace net |
| OLD | NEW |