| 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/values.h" |
| 8 #include "net/test/test_server.h" |
| 9 |
| 10 namespace net { |
| 11 |
| 12 LocalSyncTestServer::LocalSyncTestServer() |
| 13 : LocalTestServer(net::TestServer::TYPE_SYNC, |
| 14 net::TestServer::kLocalhost, |
| 15 FilePath()), |
| 16 xmpp_port_(0) {} |
| 17 |
| 18 LocalSyncTestServer::LocalSyncTestServer(uint16 port, uint16 xmpp_port) |
| 19 : LocalTestServer(net::TestServer::TYPE_SYNC, |
| 20 net::TestServer::kLocalhost, |
| 21 FilePath()), |
| 22 xmpp_port_(xmpp_port) { |
| 23 SetPort(port); |
| 24 } |
| 25 |
| 26 LocalSyncTestServer::~LocalSyncTestServer() {} |
| 27 |
| 28 bool LocalSyncTestServer::GenerateArguments( |
| 29 base::DictionaryValue* arguments) const { |
| 30 BaseTestServer::GenerateArguments(arguments); |
| 31 if (xmpp_port_ != 0) { |
| 32 arguments->SetInteger("xmpp-port", xmpp_port_); |
| 33 } |
| 34 return true; |
| 35 } |
| 36 |
| 37 void LocalSyncTestServer::CleanUpWhenStoppingServer() { |
| 38 BaseTestServer::CleanUpWhenStoppingServer(); |
| 39 xmpp_port_ = 0; |
| 40 } |
| 41 |
| 42 } // namespace net |
| OLD | NEW |