| 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_BASE_TEST_SERVER_H_ | 5 #ifndef NET_TEST_BASE_TEST_SERVER_H_ |
| 6 #define NET_TEST_BASE_TEST_SERVER_H_ | 6 #define NET_TEST_BASE_TEST_SERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // Set path of test resources. | 199 // Set path of test resources. |
| 200 void SetResourcePath(const FilePath& document_root, | 200 void SetResourcePath(const FilePath& document_root, |
| 201 const FilePath& certificates_dir); | 201 const FilePath& certificates_dir); |
| 202 | 202 |
| 203 // Parses the server data read from the test server. Returns true | 203 // Parses the server data read from the test server. Returns true |
| 204 // on success. | 204 // on success. |
| 205 bool ParseServerData(const std::string& server_data) WARN_UNUSED_RESULT; | 205 bool ParseServerData(const std::string& server_data) WARN_UNUSED_RESULT; |
| 206 | 206 |
| 207 // Generates a DictionaryValue with the arguments for launching the external | 207 // Generates a DictionaryValue with the arguments for launching the external |
| 208 // Python test server. | 208 // Python test server. |
| 209 bool GenerateArguments(base::DictionaryValue* arguments) const; | 209 bool GenerateArguments(base::DictionaryValue* arguments) const |
| 210 WARN_UNUSED_RESULT; |
| 211 |
| 212 // Subclasses can override this to add arguments that are specific to their |
| 213 // own test servers. |
| 214 virtual bool GenerateAdditionalArguments( |
| 215 base::DictionaryValue* arguments) const WARN_UNUSED_RESULT; |
| 210 | 216 |
| 211 private: | 217 private: |
| 212 void Init(const std::string& host); | 218 void Init(const std::string& host); |
| 213 | 219 |
| 214 // Marks the root certificate of an HTTPS test server as trusted for | 220 // Marks the root certificate of an HTTPS test server as trusted for |
| 215 // the duration of tests. | 221 // the duration of tests. |
| 216 bool LoadTestRootCert() const WARN_UNUSED_RESULT; | 222 bool LoadTestRootCert() const WARN_UNUSED_RESULT; |
| 217 | 223 |
| 218 // Document root of the test server. | 224 // Document root of the test server. |
| 219 FilePath document_root_; | 225 FilePath document_root_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 241 | 247 |
| 242 scoped_ptr<ScopedPortException> allowed_port_; | 248 scoped_ptr<ScopedPortException> allowed_port_; |
| 243 | 249 |
| 244 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); | 250 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); |
| 245 }; | 251 }; |
| 246 | 252 |
| 247 } // namespace net | 253 } // namespace net |
| 248 | 254 |
| 249 #endif // NET_TEST_BASE_TEST_SERVER_H_ | 255 #endif // NET_TEST_BASE_TEST_SERVER_H_ |
| 250 | 256 |
| OLD | NEW |