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

Unified 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: Integrate the definition of kLocalhost to facilitate follow-up CLs. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/test/test_server.cc » ('j') | net/tools/testserver/testserver.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/test_server.h
diff --git a/net/test/test_server.h b/net/test/test_server.h
index 18c142011b635738ae4c11955b08ff5517083dec..da5c0e90556c193d2c97900f0b0f79c3dbf0573f 100644
--- a/net/test/test_server.h
+++ b/net/test/test_server.h
@@ -110,8 +110,17 @@ class TestServer {
bool record_resume;
};
+ // Pass as the 'host' parameter during construction to server on 127.0.0.1
+ static const char* kLocalhost;
eroman 2012/02/23 20:55:07 Technically this is ambiguous, since "localhost" m
+
+ // Initialize a TestServer listening on 127.0.0.1.
TestServer(Type type, const FilePath& document_root);
+ // Initialize a TestServer listening on a specific host (IP or hostname).
+ TestServer(Type type,
+ const std::string& host,
+ const FilePath& document_root);
+
// Initialize a HTTPS TestServer with a specific set of HTTPSOptions.
TestServer(const HTTPSOptions& https_options,
const FilePath& document_root);
@@ -144,7 +153,7 @@ class TestServer {
std::string* replacement_path);
private:
- void Init(const FilePath& document_root);
+ void Init(const std::string& host, const FilePath& document_root);
// Modify PYTHONPATH to contain libraries we need.
bool SetPythonPath() WARN_UNUSED_RESULT;
« no previous file with comments | « no previous file | net/test/test_server.cc » ('j') | net/tools/testserver/testserver.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698