| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ | 5 #ifndef NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ |
| 6 #define NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ | 6 #define NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 #include <utility> | 11 #include <utility> |
| 10 #include <vector> | 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 16 #include "net/base/host_port_pair.h" | 19 #include "net/base/host_port_pair.h" |
| 17 #include "net/ssl/ssl_client_cert_type.h" | 20 #include "net/ssl/ssl_client_cert_type.h" |
| 18 | 21 |
| 19 class GURL; | 22 class GURL; |
| 20 | 23 |
| 21 namespace base { | 24 namespace base { |
| 22 class DictionaryValue; | 25 class DictionaryValue; |
| 23 } | 26 } |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 152 |
| 150 // The certificate to use when serving requests. | 153 // The certificate to use when serving requests. |
| 151 ServerCertificate server_certificate; | 154 ServerCertificate server_certificate; |
| 152 | 155 |
| 153 // If |server_certificate==CERT_AUTO| then this determines the type of OCSP | 156 // If |server_certificate==CERT_AUTO| then this determines the type of OCSP |
| 154 // response returned. | 157 // response returned. |
| 155 OCSPStatus ocsp_status; | 158 OCSPStatus ocsp_status; |
| 156 | 159 |
| 157 // If not zero, |cert_serial| will be the serial number of the | 160 // If not zero, |cert_serial| will be the serial number of the |
| 158 // auto-generated leaf certificate when |server_certificate==CERT_AUTO|. | 161 // auto-generated leaf certificate when |server_certificate==CERT_AUTO|. |
| 159 uint64 cert_serial; | 162 uint64_t cert_serial; |
| 160 | 163 |
| 161 // True if a CertificateRequest should be sent to the client during | 164 // True if a CertificateRequest should be sent to the client during |
| 162 // handshaking. | 165 // handshaking. |
| 163 bool request_client_certificate; | 166 bool request_client_certificate; |
| 164 | 167 |
| 165 // If |request_client_certificate| is true, an optional list of files, | 168 // If |request_client_certificate| is true, an optional list of files, |
| 166 // each containing a single, PEM-encoded X.509 certificates. The subject | 169 // each containing a single, PEM-encoded X.509 certificates. The subject |
| 167 // from each certificate will be added to the certificate_authorities | 170 // from each certificate will be added to the certificate_authorities |
| 168 // field of the CertificateRequest. | 171 // field of the CertificateRequest. |
| 169 std::vector<base::FilePath> client_authorities; | 172 std::vector<base::FilePath> client_authorities; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 293 |
| 291 // Returns the certificate that the server is using. | 294 // Returns the certificate that the server is using. |
| 292 scoped_refptr<X509Certificate> GetCertificate() const; | 295 scoped_refptr<X509Certificate> GetCertificate() const; |
| 293 | 296 |
| 294 protected: | 297 protected: |
| 295 virtual ~BaseTestServer(); | 298 virtual ~BaseTestServer(); |
| 296 Type type() const { return type_; } | 299 Type type() const { return type_; } |
| 297 | 300 |
| 298 // Gets port currently assigned to host_port_pair_ without checking | 301 // Gets port currently assigned to host_port_pair_ without checking |
| 299 // whether it's available (server started) or not. | 302 // whether it's available (server started) or not. |
| 300 uint16 GetPort(); | 303 uint16_t GetPort(); |
| 301 | 304 |
| 302 // Sets |port| as the actual port used by Python based test server. | 305 // Sets |port| as the actual port used by Python based test server. |
| 303 void SetPort(uint16 port); | 306 void SetPort(uint16_t port); |
| 304 | 307 |
| 305 // Set up internal status when the server is started. | 308 // Set up internal status when the server is started. |
| 306 bool SetupWhenServerStarted() WARN_UNUSED_RESULT; | 309 bool SetupWhenServerStarted() WARN_UNUSED_RESULT; |
| 307 | 310 |
| 308 // Clean up internal status when starting to stop server. | 311 // Clean up internal status when starting to stop server. |
| 309 void CleanUpWhenStoppingServer(); | 312 void CleanUpWhenStoppingServer(); |
| 310 | 313 |
| 311 // Set path of test resources. | 314 // Set path of test resources. |
| 312 void SetResourcePath(const base::FilePath& document_root, | 315 void SetResourcePath(const base::FilePath& document_root, |
| 313 const base::FilePath& certificates_dir); | 316 const base::FilePath& certificates_dir); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 bool no_anonymous_ftp_user_; | 363 bool no_anonymous_ftp_user_; |
| 361 | 364 |
| 362 scoped_ptr<ScopedPortException> allowed_port_; | 365 scoped_ptr<ScopedPortException> allowed_port_; |
| 363 | 366 |
| 364 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); | 367 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); |
| 365 }; | 368 }; |
| 366 | 369 |
| 367 } // namespace net | 370 } // namespace net |
| 368 | 371 |
| 369 #endif // NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ | 372 #endif // NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ |
| OLD | NEW |