Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: net/test/test_server.h

Issue 9369029: Add '--host' option to testserver.py and expose it via a new TestServer constructor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/test/test_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // HTTPS server, or BULK_CIPHER_ANY to indicate that all implemented 103 // HTTPS server, or BULK_CIPHER_ANY to indicate that all implemented
104 // ciphers are acceptable. 104 // ciphers are acceptable.
105 int bulk_ciphers; 105 int bulk_ciphers;
106 106
107 // If true, pass the --https-record-resume argument to testserver.py which 107 // If true, pass the --https-record-resume argument to testserver.py which
108 // causes it to log session cache actions and echo the log on 108 // causes it to log session cache actions and echo the log on
109 // /ssl-session-cache. 109 // /ssl-session-cache.
110 bool record_resume; 110 bool record_resume;
111 }; 111 };
112 112
113 // Initialize a TestServer listening on 127.0.0.1.
113 TestServer(Type type, const FilePath& document_root); 114 TestServer(Type type, const FilePath& document_root);
114 115
116 // Initialize a TestServer listening on a specific host (IP or hostname).
Paweł Hajdan Jr. 2012/02/15 17:13:10 Please don't add a 3rd ctor. Fit it into existing
erikwright (departed) 2012/02/16 14:31:02 This would touch something on the order of 64 file
117 TestServer(Type type,
118 const std::string& host,
119 const FilePath& document_root);
120
115 // Initialize a HTTPS TestServer with a specific set of HTTPSOptions. 121 // Initialize a HTTPS TestServer with a specific set of HTTPSOptions.
116 TestServer(const HTTPSOptions& https_options, 122 TestServer(const HTTPSOptions& https_options,
117 const FilePath& document_root); 123 const FilePath& document_root);
118 124
119 ~TestServer(); 125 ~TestServer();
120 126
121 bool Start() WARN_UNUSED_RESULT; 127 bool Start() WARN_UNUSED_RESULT;
122 128
123 // Stop the server started by Start(). 129 // Stop the server started by Start().
124 bool Stop(); 130 bool Stop();
(...skipping 12 matching lines...) Expand all
137 GURL GetURLWithUserAndPassword(const std::string& path, 143 GURL GetURLWithUserAndPassword(const std::string& path,
138 const std::string& user, 144 const std::string& user,
139 const std::string& password) const; 145 const std::string& password) const;
140 146
141 static bool GetFilePathWithReplacements( 147 static bool GetFilePathWithReplacements(
142 const std::string& original_path, 148 const std::string& original_path,
143 const std::vector<StringPair>& text_to_replace, 149 const std::vector<StringPair>& text_to_replace,
144 std::string* replacement_path); 150 std::string* replacement_path);
145 151
146 private: 152 private:
147 void Init(const FilePath& document_root); 153 void Init(const std::string& host, const FilePath& document_root);
148 154
149 // Modify PYTHONPATH to contain libraries we need. 155 // Modify PYTHONPATH to contain libraries we need.
150 bool SetPythonPath() WARN_UNUSED_RESULT; 156 bool SetPythonPath() WARN_UNUSED_RESULT;
151 157
152 // Launches the Python test server. Returns true on success. 158 // Launches the Python test server. Returns true on success.
153 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT; 159 bool LaunchPython(const FilePath& testserver_path) WARN_UNUSED_RESULT;
154 160
155 // Waits for the server to start. Returns true on success. 161 // Waits for the server to start. Returns true on success.
156 bool WaitToStart() WARN_UNUSED_RESULT; 162 bool WaitToStart() WARN_UNUSED_RESULT;
157 163
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 219
214 // Enables logging of the server to the console. 220 // Enables logging of the server to the console.
215 bool log_to_console_; 221 bool log_to_console_;
216 222
217 DISALLOW_COPY_AND_ASSIGN(TestServer); 223 DISALLOW_COPY_AND_ASSIGN(TestServer);
218 }; 224 };
219 225
220 } // namespace net 226 } // namespace net
221 227
222 #endif // NET_TEST_TEST_SERVER_H_ 228 #endif // NET_TEST_TEST_SERVER_H_
OLDNEW
« no previous file with comments | « no previous file | net/test/test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698