| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "sync/test/local_sync_test_server.h" | 5 #include "sync/test/local_sync_test_server.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "net/test/python_utils.h" | 11 #include "net/test/python_utils.h" |
| 12 #include "net/test/test_server.h" | 12 #include "net/test/test_server.h" |
| 13 | 13 |
| 14 namespace syncer { | 14 namespace syncer { |
| 15 | 15 |
| 16 LocalSyncTestServer::LocalSyncTestServer() | 16 LocalSyncTestServer::LocalSyncTestServer() |
| 17 : LocalTestServer(net::TestServer::TYPE_HTTP, // Sync uses the HTTP scheme. | 17 : LocalTestServer(net::TestServer::TYPE_HTTP, // Sync uses the HTTP scheme. |
| 18 net::TestServer::kLocalhost, | 18 net::TestServer::kLocalhost, |
| 19 base::FilePath()), | 19 GetSourcePath()), |
| 20 xmpp_port_(0) {} | 20 xmpp_port_(0) {} |
| 21 | 21 |
| 22 LocalSyncTestServer::LocalSyncTestServer(uint16 port, uint16 xmpp_port) | 22 LocalSyncTestServer::LocalSyncTestServer(uint16 port, uint16 xmpp_port) |
| 23 : LocalTestServer(net::TestServer::TYPE_HTTP, // Sync uses the HTTP scheme. | 23 : LocalTestServer(net::TestServer::TYPE_HTTP, // Sync uses the HTTP scheme. |
| 24 net::TestServer::kLocalhost, | 24 net::TestServer::kLocalhost, |
| 25 base::FilePath()), | 25 GetSourcePath()), |
| 26 xmpp_port_(xmpp_port) { | 26 xmpp_port_(xmpp_port) { |
| 27 SetPort(port); | 27 SetPort(port); |
| 28 } | 28 } |
| 29 | 29 |
| 30 LocalSyncTestServer::~LocalSyncTestServer() {} | 30 LocalSyncTestServer::~LocalSyncTestServer() {} |
| 31 | 31 |
| 32 bool LocalSyncTestServer::AddCommandLineArguments( | 32 bool LocalSyncTestServer::AddCommandLineArguments( |
| 33 CommandLine* command_line) const { | 33 CommandLine* command_line) const { |
| 34 if (!LocalTestServer::AddCommandLineArguments(command_line)) | 34 if (!LocalTestServer::AddCommandLineArguments(command_line)) |
| 35 return false; | 35 return false; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if (!GetPyProtoPath(&pyproto_dir)) { | 84 if (!GetPyProtoPath(&pyproto_dir)) { |
| 85 LOG(WARNING) << "Cannot find pyproto dir for generated code. " | 85 LOG(WARNING) << "Cannot find pyproto dir for generated code. " |
| 86 << "Testserver features that rely on it will not work"; | 86 << "Testserver features that rely on it will not work"; |
| 87 return true; | 87 return true; |
| 88 } | 88 } |
| 89 AppendToPythonPath(pyproto_dir.AppendASCII("sync").AppendASCII("protocol")); | 89 AppendToPythonPath(pyproto_dir.AppendASCII("sync").AppendASCII("protocol")); |
| 90 return true; | 90 return true; |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace syncer | 93 } // namespace syncer |
| OLD | NEW |