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 "components/sync/test/local_sync_test_server.h" | 5 #include "components/sync/test/local_sync_test_server.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 return true; | 46 return true; |
47 } | 47 } |
48 | 48 |
49 bool LocalSyncTestServer::GetTestServerPath( | 49 bool LocalSyncTestServer::GetTestServerPath( |
50 base::FilePath* testserver_path) const { | 50 base::FilePath* testserver_path) const { |
51 base::FilePath testserver_dir; | 51 base::FilePath testserver_dir; |
52 if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_dir)) { | 52 if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_dir)) { |
53 LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT"; | 53 LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT"; |
54 return false; | 54 return false; |
55 } | 55 } |
56 testserver_dir = testserver_dir.Append(FILE_PATH_LITERAL("sync")) | 56 testserver_dir = testserver_dir.Append(FILE_PATH_LITERAL("components")) |
| 57 .Append(FILE_PATH_LITERAL("sync")) |
57 .Append(FILE_PATH_LITERAL("tools")) | 58 .Append(FILE_PATH_LITERAL("tools")) |
58 .Append(FILE_PATH_LITERAL("testserver")); | 59 .Append(FILE_PATH_LITERAL("testserver")); |
59 | 60 |
60 *testserver_path = | 61 *testserver_path = |
61 testserver_dir.Append(FILE_PATH_LITERAL("sync_testserver.py")); | 62 testserver_dir.Append(FILE_PATH_LITERAL("sync_testserver.py")); |
62 return true; | 63 return true; |
63 } | 64 } |
64 | 65 |
65 bool LocalSyncTestServer::GetTestScriptPath( | 66 bool LocalSyncTestServer::GetTestScriptPath( |
66 const base::FilePath::StringType& test_script_name, | 67 const base::FilePath::StringType& test_script_name, |
(...skipping 18 matching lines...) Expand all Loading... |
85 } | 86 } |
86 AppendToPythonPath(net_testserver_path.DirName()); | 87 AppendToPythonPath(net_testserver_path.DirName()); |
87 | 88 |
88 // Locate the Python code generated by the sync protocol buffers compiler. | 89 // Locate the Python code generated by the sync protocol buffers compiler. |
89 base::FilePath pyproto_dir; | 90 base::FilePath pyproto_dir; |
90 if (!GetPyProtoPath(&pyproto_dir)) { | 91 if (!GetPyProtoPath(&pyproto_dir)) { |
91 LOG(WARNING) << "Cannot find pyproto dir for generated code. " | 92 LOG(WARNING) << "Cannot find pyproto dir for generated code. " |
92 << "Testserver features that rely on it will not work"; | 93 << "Testserver features that rely on it will not work"; |
93 return true; | 94 return true; |
94 } | 95 } |
95 AppendToPythonPath(pyproto_dir.AppendASCII("sync").AppendASCII("protocol")); | 96 AppendToPythonPath(pyproto_dir.AppendASCII("components") |
| 97 .AppendASCII("sync") |
| 98 .AppendASCII("protocol")); |
96 return true; | 99 return true; |
97 } | 100 } |
98 | 101 |
99 } // namespace syncer | 102 } // namespace syncer |
OLD | NEW |