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 #ifndef NET_BASE_SSL_TEST_UTIL_H_ | 5 #ifndef NET_BASE_SSL_TEST_UTIL_H_ |
6 #define NET_BASE_SSL_TEST_UTIL_H_ | 6 #define NET_BASE_SSL_TEST_UTIL_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 21 matching lines...) Expand all Loading... |
32 enum Protocol { | 32 enum Protocol { |
33 ProtoHTTP, ProtoFTP | 33 ProtoHTTP, ProtoFTP |
34 }; | 34 }; |
35 | 35 |
36 // Load the test root cert, if it hasn't been loaded yet. | 36 // Load the test root cert, if it hasn't been loaded yet. |
37 bool LoadTestRootCert(); | 37 bool LoadTestRootCert(); |
38 | 38 |
39 // Start src/net/tools/testserver/testserver.py and | 39 // Start src/net/tools/testserver/testserver.py and |
40 // ask it to serve the given protocol. | 40 // ask it to serve the given protocol. |
41 // If protocol is HTTP, and cert_path is not empty, serves HTTPS. | 41 // If protocol is HTTP, and cert_path is not empty, serves HTTPS. |
| 42 // file_root_url specifies the root url on the server that documents will be |
| 43 // served out of. This is /files/ by default. |
42 // Returns true on success, false if files not found or root cert | 44 // Returns true on success, false if files not found or root cert |
43 // not trusted. | 45 // not trusted. |
44 bool Start(Protocol protocol, | 46 bool Start(Protocol protocol, |
45 const std::string& host_name, int port, | 47 const std::string& host_name, int port, |
46 const FilePath& document_root, | 48 const FilePath& document_root, |
47 const FilePath& cert_path); | 49 const FilePath& cert_path, |
| 50 const std::wstring& file_root_url); |
48 | 51 |
49 // Stop the server started by Start(). | 52 // Stop the server started by Start(). |
50 bool Stop(); | 53 bool Stop(); |
51 | 54 |
52 // If you access the server's Kill url, it will exit by itself | 55 // If you access the server's Kill url, it will exit by itself |
53 // without a call to Stop(). | 56 // without a call to Stop(). |
54 // WaitToFinish is handy in that case. | 57 // WaitToFinish is handy in that case. |
55 // It returns true if the server exited cleanly. | 58 // It returns true if the server exited cleanly. |
56 bool WaitToFinish(int milliseconds); | 59 bool WaitToFinish(int milliseconds); |
57 | 60 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 struct PrivateCERTCertificate; | 106 struct PrivateCERTCertificate; |
104 PrivateCERTCertificate *cert_; | 107 PrivateCERTCertificate *cert_; |
105 #endif | 108 #endif |
106 | 109 |
107 DISALLOW_COPY_AND_ASSIGN(TestServerLauncher); | 110 DISALLOW_COPY_AND_ASSIGN(TestServerLauncher); |
108 }; | 111 }; |
109 | 112 |
110 } | 113 } |
111 | 114 |
112 #endif // NET_BASE_SSL_TEST_UTIL_H_ | 115 #endif // NET_BASE_SSL_TEST_UTIL_H_ |
OLD | NEW |