OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test_server.h" | 5 #include "net/test/test_server.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 AppendToPythonPath(pyproto_code_dir.Append( | 316 AppendToPythonPath(pyproto_code_dir.Append( |
317 FILE_PATH_LITERAL("device_management_pb"))); | 317 FILE_PATH_LITERAL("device_management_pb"))); |
318 | 318 |
319 return true; | 319 return true; |
320 } | 320 } |
321 | 321 |
322 bool TestServer::ParseServerData(const std::string& server_data) { | 322 bool TestServer::ParseServerData(const std::string& server_data) { |
323 VLOG(1) << "Server data: " << server_data; | 323 VLOG(1) << "Server data: " << server_data; |
324 base::JSONReader json_reader; | 324 base::JSONReader json_reader; |
325 scoped_ptr<Value> value(json_reader.JsonToValue(server_data, true, false)); | 325 scoped_ptr<Value> value(json_reader.JsonToValue(server_data, true, false)); |
326 if (!value.get() || | 326 if (!value.get() || !value->IsDictionary()) { |
327 !value->IsType(Value::TYPE_DICTIONARY)) { | |
328 LOG(ERROR) << "Could not parse server data: " | 327 LOG(ERROR) << "Could not parse server data: " |
329 << json_reader.GetErrorMessage(); | 328 << json_reader.GetErrorMessage(); |
330 return false; | 329 return false; |
331 } | 330 } |
332 server_data_.reset(static_cast<DictionaryValue*>(value.release())); | 331 server_data_.reset(static_cast<DictionaryValue*>(value.release())); |
333 int port = 0; | 332 int port = 0; |
334 if (!server_data_->GetInteger("port", &port)) { | 333 if (!server_data_->GetInteger("port", &port)) { |
335 LOG(ERROR) << "Could not find port value"; | 334 LOG(ERROR) << "Could not find port value"; |
336 return false; | 335 return false; |
337 } | 336 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_AES256) | 405 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_AES256) |
407 command_line->AppendArg(kBulkCipherSwitch + "=aes256"); | 406 command_line->AppendArg(kBulkCipherSwitch + "=aes256"); |
408 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_3DES) | 407 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_3DES) |
409 command_line->AppendArg(kBulkCipherSwitch + "=3des"); | 408 command_line->AppendArg(kBulkCipherSwitch + "=3des"); |
410 } | 409 } |
411 | 410 |
412 return true; | 411 return true; |
413 } | 412 } |
414 | 413 |
415 } // namespace net | 414 } // namespace net |
OLD | NEW |