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

Side by Side Diff: net/tools/testserver/run_testserver.cc

Issue 9545019: Add "run_testserver --sync-test" for easy chromiumsync_test.py launching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« net/test/test_server.cc ('K') | « net/test/test_server_win.cc ('k') | no next file » | 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) 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 #include <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 return -1; 44 return -1;
45 } 45 }
46 46
47 net::TestServer::Type server_type(net::TestServer::TYPE_HTTP); 47 net::TestServer::Type server_type(net::TestServer::TYPE_HTTP);
48 if (command_line->HasSwitch("https")) { 48 if (command_line->HasSwitch("https")) {
49 server_type = net::TestServer::TYPE_HTTPS; 49 server_type = net::TestServer::TYPE_HTTPS;
50 } else if (command_line->HasSwitch("ftp")) { 50 } else if (command_line->HasSwitch("ftp")) {
51 server_type = net::TestServer::TYPE_FTP; 51 server_type = net::TestServer::TYPE_FTP;
52 } else if (command_line->HasSwitch("sync")) { 52 } else if (command_line->HasSwitch("sync")) {
53 server_type = net::TestServer::TYPE_SYNC; 53 server_type = net::TestServer::TYPE_SYNC;
54 } else if (command_line->HasSwitch("sync-test")) {
55 return net::TestServer::RunSyncTest() ? 0 : -1;
54 } 56 }
55 57
56 net::TestServer::HTTPSOptions https_options; 58 net::TestServer::HTTPSOptions https_options;
57 if (command_line->HasSwitch("https-cert")) { 59 if (command_line->HasSwitch("https-cert")) {
58 server_type = net::TestServer::TYPE_HTTPS; 60 server_type = net::TestServer::TYPE_HTTPS;
59 std::string cert_option = command_line->GetSwitchValueASCII("https-cert"); 61 std::string cert_option = command_line->GetSwitchValueASCII("https-cert");
60 if (cert_option == "ok") { 62 if (cert_option == "ok") {
61 https_options.server_certificate = net::TestServer::HTTPSOptions::CERT_OK; 63 https_options.server_certificate = net::TestServer::HTTPSOptions::CERT_OK;
62 } else if (cert_option == "mismatched-name") { 64 } else if (cert_option == "mismatched-name") {
63 https_options.server_certificate = 65 https_options.server_certificate =
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 UTF16ToUTF8(test_server->document_root().LossyDisplayName()).c_str()); 99 UTF16ToUTF8(test_server->document_root().LossyDisplayName()).c_str());
98 return -1; 100 return -1;
99 } 101 }
100 102
101 printf("testserver running at %s (type ctrl+c to exit)\n", 103 printf("testserver running at %s (type ctrl+c to exit)\n",
102 test_server->host_port_pair().ToString().c_str()); 104 test_server->host_port_pair().ToString().c_str());
103 105
104 message_loop.Run(); 106 message_loop.Run();
105 return 0; 107 return 0;
106 } 108 }
OLDNEW
« net/test/test_server.cc ('K') | « net/test/test_server_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698