OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 10 #include <utility> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 GURL GetURLWithUserAndPassword(const std::string& path, | 141 GURL GetURLWithUserAndPassword(const std::string& path, |
142 const std::string& user, | 142 const std::string& user, |
143 const std::string& password) const; | 143 const std::string& password) const; |
144 | 144 |
145 static bool GetFilePathWithReplacements( | 145 static bool GetFilePathWithReplacements( |
146 const std::string& original_path, | 146 const std::string& original_path, |
147 const std::vector<StringPair>& text_to_replace, | 147 const std::vector<StringPair>& text_to_replace, |
148 std::string* replacement_path); | 148 std::string* replacement_path); |
149 | 149 |
| 150 // Modify PYTHONPATH to contain libraries we need. |
| 151 static bool SetPythonPath() WARN_UNUSED_RESULT; |
| 152 |
| 153 // Return the path containing testserver python script. |
| 154 static FilePath GetTestServerDirectory(); |
| 155 |
150 private: | 156 private: |
151 void Init(const std::string& host, const FilePath& document_root); | 157 void Init(const std::string& host, const FilePath& document_root); |
152 | 158 |
153 // Modify PYTHONPATH to contain libraries we need. | |
154 bool SetPythonPath() WARN_UNUSED_RESULT; | |
155 | |
156 // Launches the Python test server. Returns true on success. | 159 // Launches the Python test server. Returns true on success. |
157 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; | 160 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; |
158 | 161 |
159 // Waits for the server to start. Returns true on success. | 162 // Waits for the server to start. Returns true on success. |
160 bool WaitToStart() WARN_UNUSED_RESULT; | 163 bool WaitToStart() WARN_UNUSED_RESULT; |
161 | 164 |
162 // Parses the server data read from the test server. Returns true | 165 // Parses the server data read from the test server. Returns true |
163 // on success. | 166 // on success. |
164 bool ParseServerData(const std::string& server_data) WARN_UNUSED_RESULT; | 167 bool ParseServerData(const std::string& server_data) WARN_UNUSED_RESULT; |
165 | 168 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 220 |
218 // Enables logging of the server to the console. | 221 // Enables logging of the server to the console. |
219 bool log_to_console_; | 222 bool log_to_console_; |
220 | 223 |
221 DISALLOW_COPY_AND_ASSIGN(TestServer); | 224 DISALLOW_COPY_AND_ASSIGN(TestServer); |
222 }; | 225 }; |
223 | 226 |
224 } // namespace net | 227 } // namespace net |
225 | 228 |
226 #endif // NET_TEST_TEST_SERVER_H_ | 229 #endif // NET_TEST_TEST_SERVER_H_ |
OLD | NEW |