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

Unified Diff: net/tools/testserver/run_testserver.cc

Issue 10879029: reland: Launch pywebsocket via net::TestServer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 8 years, 4 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
Index: net/tools/testserver/run_testserver.cc
diff --git a/net/tools/testserver/run_testserver.cc b/net/tools/testserver/run_testserver.cc
index c02d4d6e18290ee6ea016f4e8998fba16db6215e..9eb7ae35233275515b7c8060d33522b4ff0985c2 100644
--- a/net/tools/testserver/run_testserver.cc
+++ b/net/tools/testserver/run_testserver.cc
@@ -18,8 +18,9 @@
#include "net/test/test_server.h"
static void PrintUsage() {
- printf("run_testserver --doc-root=relpath [--http|--https|--ftp|--sync]\n"
- " [--https-cert=ok|mismatched-name|expired]\n"
+ printf("run_testserver --doc-root=relpath\n"
+ " [--http|--https|--ws|--wss|--ftp|--sync]\n"
+ " [--ssl-cert=ok|mismatched-name|expired]\n"
" [--port=<port>] [--xmpp-port=<xmpp_port>]\n");
printf("(NOTE: relpath should be relative to the 'src' directory.\n");
printf(" --port and --xmpp-port only work with the --sync flag.)\n");
@@ -104,6 +105,10 @@ int main(int argc, const char* argv[]) {
net::TestServer::Type server_type(net::TestServer::TYPE_HTTP);
if (command_line->HasSwitch("https")) {
server_type = net::TestServer::TYPE_HTTPS;
+ } else if (command_line->HasSwitch("ws")) {
+ server_type = net::TestServer::TYPE_WS;
+ } else if (command_line->HasSwitch("wss")) {
+ server_type = net::TestServer::TYPE_WSS;
} else if (command_line->HasSwitch("ftp")) {
server_type = net::TestServer::TYPE_FTP;
} else if (command_line->HasSwitch("sync")) {
@@ -113,9 +118,10 @@ int main(int argc, const char* argv[]) {
}
net::TestServer::SSLOptions ssl_options;
- if (command_line->HasSwitch("https-cert")) {
- server_type = net::TestServer::TYPE_HTTPS;
- std::string cert_option = command_line->GetSwitchValueASCII("https-cert");
+ if (command_line->HasSwitch("ssl-cert")) {
+ if (server_type == net::TestServer::TYPE_HTTP)
Ryan Sleevi 2012/08/30 02:54:14 Do you not need to also have a mapping of TYPE_WS
Takashi Toyoshima 2012/08/31 17:38:20 If no scheme option is specified, TYPE_HTTP is use
+ server_type = net::TestServer::TYPE_HTTPS;
+ std::string cert_option = command_line->GetSwitchValueASCII("ssl-cert");
if (cert_option == "ok") {
ssl_options.server_certificate = net::TestServer::SSLOptions::CERT_OK;
} else if (cert_option == "mismatched-name") {
@@ -140,7 +146,8 @@ int main(int argc, const char* argv[]) {
scoped_ptr<net::TestServer> test_server;
switch (server_type) {
- case net::TestServer::TYPE_HTTPS: {
+ case net::TestServer::TYPE_HTTPS:
+ case net::TestServer::TYPE_WSS: {
test_server.reset(new net::TestServer(server_type,
ssl_options,
doc_root));

Powered by Google App Engine
This is Rietveld 408576698