| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "net/test/local_sync_test_server.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "base/string_number_conversions.h" | |
| 9 #include "base/values.h" | |
| 10 #include "net/test/test_server.h" | |
| 11 | |
| 12 namespace net { | |
| 13 | |
| 14 LocalSyncTestServer::LocalSyncTestServer() | |
| 15 : LocalTestServer(net::TestServer::TYPE_SYNC, | |
| 16 net::TestServer::kLocalhost, | |
| 17 FilePath()), | |
| 18 xmpp_port_(0) {} | |
| 19 | |
| 20 LocalSyncTestServer::LocalSyncTestServer(uint16 port, uint16 xmpp_port) | |
| 21 : LocalTestServer(net::TestServer::TYPE_SYNC, | |
| 22 net::TestServer::kLocalhost, | |
| 23 FilePath()), | |
| 24 xmpp_port_(xmpp_port) { | |
| 25 SetPort(port); | |
| 26 } | |
| 27 | |
| 28 LocalSyncTestServer::~LocalSyncTestServer() {} | |
| 29 | |
| 30 bool LocalSyncTestServer::AddCommandLineArguments( | |
| 31 CommandLine* command_line) const { | |
| 32 if (!LocalTestServer::AddCommandLineArguments(command_line)) | |
| 33 return false; | |
| 34 if (xmpp_port_ != 0) { | |
| 35 std::string xmpp_port_str = base::IntToString(xmpp_port_); | |
| 36 command_line->AppendArg("--xmpp-port=" + xmpp_port_str); | |
| 37 } | |
| 38 return true; | |
| 39 } | |
| 40 | |
| 41 } // namespace net | |
| OLD | NEW |