Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: net/test/local_test_server.cc

Issue 12235003: Split out policy code from net/tools/testserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 80 chars. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/test/data/policy/policy_device_management_service_browsertest.json ('k') | net/tools/testserver/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698