OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/test_server.h" | 5 #include "net/test/test_server.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 | 12 |
13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
14 #include <windows.h> | 14 #include <windows.h> |
15 #include <wincrypt.h> | 15 #include <wincrypt.h> |
16 #elif defined(OS_MACOSX) | 16 #elif defined(OS_MACOSX) |
17 #include "net/base/x509_certificate.h" | 17 #include "net/base/x509_certificate.h" |
18 #endif | 18 #endif |
19 | 19 |
20 #include "base/file_util.h" | 20 #include "base/file_util.h" |
21 #include "base/leak_annotations.h" | 21 #include "base/leak_annotations.h" |
22 #include "base/logging.h" | 22 #include "base/logging.h" |
23 #include "base/path_service.h" | 23 #include "base/path_service.h" |
24 #include "base/string_util.h" | 24 #include "base/string_number_conversions.h" |
25 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
26 #include "net/base/cert_test_util.h" | 26 #include "net/base/cert_test_util.h" |
27 #include "net/base/host_resolver.h" | 27 #include "net/base/host_resolver.h" |
28 #include "net/base/test_completion_callback.h" | 28 #include "net/base/test_completion_callback.h" |
29 #include "net/socket/tcp_client_socket.h" | 29 #include "net/socket/tcp_client_socket.h" |
30 #include "net/socket/tcp_pinger.h" | 30 #include "net/socket/tcp_pinger.h" |
31 #include "testing/platform_test.h" | 31 #include "testing/platform_test.h" |
32 | 32 |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #pragma comment(lib, "crypt32.lib") | 34 #pragma comment(lib, "crypt32.lib") |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 const FilePath& document_root, | 127 const FilePath& document_root, |
128 const FilePath& cert_path, | 128 const FilePath& cert_path, |
129 const std::wstring& file_root_url) { | 129 const std::wstring& file_root_url) { |
130 if (!cert_path.value().empty()) { | 130 if (!cert_path.value().empty()) { |
131 if (!LoadTestRootCert()) | 131 if (!LoadTestRootCert()) |
132 return false; | 132 return false; |
133 if (!CheckCATrusted()) | 133 if (!CheckCATrusted()) |
134 return false; | 134 return false; |
135 } | 135 } |
136 | 136 |
137 std::string port_str = IntToString(port); | 137 std::string port_str = base::IntToString(port); |
138 | 138 |
139 // Get path to python server script | 139 // Get path to python server script |
140 FilePath testserver_path; | 140 FilePath testserver_path; |
141 if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_path)) | 141 if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_path)) |
142 return false; | 142 return false; |
143 testserver_path = testserver_path | 143 testserver_path = testserver_path |
144 .Append(FILE_PATH_LITERAL("net")) | 144 .Append(FILE_PATH_LITERAL("net")) |
145 .Append(FILE_PATH_LITERAL("tools")) | 145 .Append(FILE_PATH_LITERAL("tools")) |
146 .Append(FILE_PATH_LITERAL("testserver")) | 146 .Append(FILE_PATH_LITERAL("testserver")) |
147 .Append(FILE_PATH_LITERAL("testserver.py")); | 147 .Append(FILE_PATH_LITERAL("testserver.py")); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 process_info.hProcess)) { | 399 process_info.hProcess)) { |
400 LOG(ERROR) << "Could not AssignProcessToObject."; | 400 LOG(ERROR) << "Could not AssignProcessToObject."; |
401 return false; | 401 return false; |
402 } | 402 } |
403 } | 403 } |
404 return true; | 404 return true; |
405 } | 405 } |
406 #endif | 406 #endif |
407 | 407 |
408 } // namespace net | 408 } // namespace net |
OLD | NEW |