Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 TestServer(const HTTPSOptions& https_options, | 106 TestServer(const HTTPSOptions& https_options, |
| 107 const FilePath& document_root); | 107 const FilePath& document_root); |
| 108 | 108 |
| 109 ~TestServer(); | 109 ~TestServer(); |
| 110 | 110 |
| 111 bool Start() WARN_UNUSED_RESULT; | 111 bool Start() WARN_UNUSED_RESULT; |
| 112 | 112 |
| 113 // Stop the server started by Start(). | 113 // Stop the server started by Start(). |
| 114 bool Stop(); | 114 bool Stop(); |
| 115 | 115 |
| 116 // Enables/disables sys.stdout logging by testserver.py (enabled by default). | |
| 117 // To disable console logging, call this method before Start(). Note: This | |
| 118 // does not affect the test server logs that are written to file. | |
| 119 void SetConsoleLogging(bool log_to_console) { | |
|
Paweł Hajdan Jr.
2011/01/29 10:26:24
Please don't add new setters to this class. Can th
Raghu Simha
2011/01/29 10:50:38
It certainly can. The reason I added this setter w
| |
| 120 log_to_console_ = log_to_console; | |
| 121 } | |
| 122 | |
| 116 const FilePath& document_root() const { return document_root_; } | 123 const FilePath& document_root() const { return document_root_; } |
| 117 const HostPortPair& host_port_pair() const; | 124 const HostPortPair& host_port_pair() const; |
| 118 const DictionaryValue& server_data() const; | 125 const DictionaryValue& server_data() const; |
| 119 std::string GetScheme() const; | 126 std::string GetScheme() const; |
| 120 bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT; | 127 bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT; |
| 121 | 128 |
| 122 GURL GetURL(const std::string& path) const; | 129 GURL GetURL(const std::string& path) const; |
| 123 | 130 |
| 124 GURL GetURLWithUser(const std::string& path, | 131 GURL GetURLWithUser(const std::string& path, |
| 125 const std::string& user) const; | 132 const std::string& user) const; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 #endif | 201 #endif |
| 195 | 202 |
| 196 // If |type_| is TYPE_HTTPS, the TLS settings to use for the test server. | 203 // If |type_| is TYPE_HTTPS, the TLS settings to use for the test server. |
| 197 HTTPSOptions https_options_; | 204 HTTPSOptions https_options_; |
| 198 | 205 |
| 199 Type type_; | 206 Type type_; |
| 200 | 207 |
| 201 // Has the server been started? | 208 // Has the server been started? |
| 202 bool started_; | 209 bool started_; |
| 203 | 210 |
| 211 // Flag that controls whether test server logs are printed to the console in | |
| 212 // addition to a log file. Has a value of true by default. | |
| 213 bool log_to_console_; | |
| 214 | |
| 204 DISALLOW_COPY_AND_ASSIGN(TestServer); | 215 DISALLOW_COPY_AND_ASSIGN(TestServer); |
| 205 }; | 216 }; |
| 206 | 217 |
| 207 } // namespace net | 218 } // namespace net |
| 208 | 219 |
| 209 #endif // NET_TEST_TEST_SERVER_H_ | 220 #endif // NET_TEST_TEST_SERVER_H_ |
| OLD | NEW |