| 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 "net/test/local_test_server.h" | 5 #include "net/test/local_test_server.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 // Locate the Python code generated by the protocol buffers compiler. | 183 // Locate the Python code generated by the protocol buffers compiler. |
| 184 base::FilePath pyproto_dir; | 184 base::FilePath pyproto_dir; |
| 185 if (!GetPyProtoPath(&pyproto_dir)) { | 185 if (!GetPyProtoPath(&pyproto_dir)) { |
| 186 LOG(WARNING) << "Cannot find pyproto dir for generated code. " | 186 LOG(WARNING) << "Cannot find pyproto dir for generated code. " |
| 187 << "Testserver features that rely on it will not work"; | 187 << "Testserver features that rely on it will not work"; |
| 188 return true; | 188 return true; |
| 189 } | 189 } |
| 190 AppendToPythonPath(pyproto_dir); | 190 AppendToPythonPath(pyproto_dir); |
| 191 | 191 |
| 192 // TODO(cloud_policy): Move this out of net/, since net/ should not have to | |
| 193 // depend on chrome/. See http://crbug.com/119403. | |
| 194 AppendToPythonPath(pyproto_dir.AppendASCII("chrome") | |
| 195 .AppendASCII("browser") | |
| 196 .AppendASCII("policy") | |
| 197 .AppendASCII("proto")); | |
| 198 | |
| 199 return true; | 192 return true; |
| 200 } | 193 } |
| 201 | 194 |
| 202 bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const { | 195 bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const { |
| 203 base::DictionaryValue arguments_dict; | 196 base::DictionaryValue arguments_dict; |
| 204 if (!GenerateArguments(&arguments_dict)) | 197 if (!GenerateArguments(&arguments_dict)) |
| 205 return false; | 198 return false; |
| 206 | 199 |
| 207 // Serialize the argument dictionary into CommandLine. | 200 // Serialize the argument dictionary into CommandLine. |
| 208 for (DictionaryValue::Iterator it(arguments_dict); it.HasNext(); | 201 for (DictionaryValue::Iterator it(arguments_dict); it.HasNext(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 break; | 243 break; |
| 251 default: | 244 default: |
| 252 NOTREACHED(); | 245 NOTREACHED(); |
| 253 return false; | 246 return false; |
| 254 } | 247 } |
| 255 | 248 |
| 256 return true; | 249 return true; |
| 257 } | 250 } |
| 258 | 251 |
| 259 } // namespace net | 252 } // namespace net |
| OLD | NEW |