| 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 // Launches the chromiumsync_test script, testing the --sync functionality. |
| 151 static bool RunSyncTest(); |
| 152 |
| 153 // Return the absolute path to the python executable for the platform. |
| 154 static FilePath GetAbsolutePythonCommandPath(); |
| 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. | 159 // Modify PYTHONPATH to contain libraries we need. |
| 154 bool SetPythonPath() WARN_UNUSED_RESULT; | 160 static bool SetPythonPath() WARN_UNUSED_RESULT; |
| 161 |
| 162 // Return the path containing testserver python script. |
| 163 static FilePath GetTestServerDirectory(); |
| 155 | 164 |
| 156 // Launches the Python test server. Returns true on success. | 165 // Launches the Python test server. Returns true on success. |
| 157 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; | 166 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; |
| 158 | 167 |
| 159 // Waits for the server to start. Returns true on success. | 168 // Waits for the server to start. Returns true on success. |
| 160 bool WaitToStart() WARN_UNUSED_RESULT; | 169 bool WaitToStart() WARN_UNUSED_RESULT; |
| 161 | 170 |
| 162 // Parses the server data read from the test server. Returns true | 171 // Parses the server data read from the test server. Returns true |
| 163 // on success. | 172 // on success. |
| 164 bool ParseServerData(const std::string& server_data) WARN_UNUSED_RESULT; | 173 bool ParseServerData(const std::string& server_data) WARN_UNUSED_RESULT; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 226 |
| 218 // Enables logging of the server to the console. | 227 // Enables logging of the server to the console. |
| 219 bool log_to_console_; | 228 bool log_to_console_; |
| 220 | 229 |
| 221 DISALLOW_COPY_AND_ASSIGN(TestServer); | 230 DISALLOW_COPY_AND_ASSIGN(TestServer); |
| 222 }; | 231 }; |
| 223 | 232 |
| 224 } // namespace net | 233 } // namespace net |
| 225 | 234 |
| 226 #endif // NET_TEST_TEST_SERVER_H_ | 235 #endif // NET_TEST_TEST_SERVER_H_ |
| OLD | NEW |