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 #ifndef NET_TEST_TEST_SERVER_H_ | 5 #ifndef NET_TEST_TEST_SERVER_H_ |
6 #define NET_TEST_TEST_SERVER_H_ | 6 #define NET_TEST_TEST_SERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 bool Start() WARN_UNUSED_RESULT; | 110 bool Start() WARN_UNUSED_RESULT; |
111 | 111 |
112 // Stop the server started by Start(). | 112 // Stop the server started by Start(). |
113 bool Stop(); | 113 bool Stop(); |
114 | 114 |
115 const FilePath& document_root() const { return document_root_; } | 115 const FilePath& document_root() const { return document_root_; } |
116 const HostPortPair& host_port_pair() const { return host_port_pair_; } | 116 const HostPortPair& host_port_pair() const { return host_port_pair_; } |
117 std::string GetScheme() const; | 117 std::string GetScheme() const; |
118 bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT; | 118 bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT; |
119 | 119 |
120 GURL GetURL(const std::string& path); | 120 GURL GetURL(const std::string& path) const; |
121 | 121 |
122 GURL GetURLWithUser(const std::string& path, | 122 GURL GetURLWithUser(const std::string& path, |
123 const std::string& user); | 123 const std::string& user) const; |
124 | 124 |
125 GURL GetURLWithUserAndPassword(const std::string& path, | 125 GURL GetURLWithUserAndPassword(const std::string& path, |
126 const std::string& user, | 126 const std::string& user, |
127 const std::string& password); | 127 const std::string& password) const; |
128 | |
129 static bool GetFilePathWithReplacements( | |
130 const std::string& original_path, | |
131 const std::vector<std::string>& text_to_replace, | |
akalin
2010/11/11 05:20:54
what about taking a vector of pairs of strings?
| |
132 std::string* replacement_path); | |
128 | 133 |
129 private: | 134 private: |
130 void Init(const FilePath& document_root); | 135 void Init(const FilePath& document_root); |
131 | 136 |
132 // Modify PYTHONPATH to contain libraries we need. | 137 // Modify PYTHONPATH to contain libraries we need. |
133 bool SetPythonPath() WARN_UNUSED_RESULT; | 138 bool SetPythonPath() WARN_UNUSED_RESULT; |
134 | 139 |
135 // Launches the Python test server. Returns true on success. | 140 // Launches the Python test server. Returns true on success. |
136 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; | 141 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; |
137 | 142 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 #endif | 193 #endif |
189 | 194 |
190 Type type_; | 195 Type type_; |
191 | 196 |
192 DISALLOW_COPY_AND_ASSIGN(TestServer); | 197 DISALLOW_COPY_AND_ASSIGN(TestServer); |
193 }; | 198 }; |
194 | 199 |
195 } // namespace net | 200 } // namespace net |
196 | 201 |
197 #endif // NET_TEST_TEST_SERVER_H_ | 202 #endif // NET_TEST_TEST_SERVER_H_ |
OLD | NEW |