| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/test/webdriver/webdriver_capabilities_parser.h" | 5 #include "chrome/test/webdriver/webdriver_capabilities_parser.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 std::set<std::string> proxy_options; | 289 std::set<std::string> proxy_options; |
| 290 proxy_options.insert("autodetect"); | 290 proxy_options.insert("autodetect"); |
| 291 proxy_options.insert("ftpProxy"); | 291 proxy_options.insert("ftpProxy"); |
| 292 proxy_options.insert("httpProxy"); | 292 proxy_options.insert("httpProxy"); |
| 293 proxy_options.insert("noProxy"); | 293 proxy_options.insert("noProxy"); |
| 294 proxy_options.insert("proxyType"); | 294 proxy_options.insert("proxyType"); |
| 295 proxy_options.insert("proxyAutoconfigUrl"); | 295 proxy_options.insert("proxyAutoconfigUrl"); |
| 296 proxy_options.insert("sslProxy"); | 296 proxy_options.insert("sslProxy"); |
| 297 proxy_options.insert("class"); // Created by BeanToJSONConverter. | 297 proxy_options.insert("class"); // Created by BeanToJSONConverter. |
| 298 | 298 |
| 299 DictionaryValue::key_iterator key_iter = options->begin_keys(); | 299 for (DictionaryValue::Iterator iter(*options); !iter.IsAtEnd(); |
| 300 for (; key_iter != options->end_keys(); ++key_iter) { | 300 iter.Advance()) { |
| 301 if (proxy_options.find(*key_iter) == proxy_options.end()) { | 301 if (proxy_options.find(iter.key()) == proxy_options.end()) { |
| 302 logger_.Log(kInfoLogLevel, "Unrecognized proxy capability: " + *key_iter); | 302 logger_.Log(kInfoLogLevel, |
| 303 "Unrecognized proxy capability: " + iter.key()); |
| 303 } | 304 } |
| 304 } | 305 } |
| 305 | 306 |
| 306 typedef Error* (CapabilitiesParser::*Parser)(const DictionaryValue*); | 307 typedef Error* (CapabilitiesParser::*Parser)(const DictionaryValue*); |
| 307 std::map<std::string, Parser> proxy_type_parser_map; | 308 std::map<std::string, Parser> proxy_type_parser_map; |
| 308 proxy_type_parser_map["autodetect"] = | 309 proxy_type_parser_map["autodetect"] = |
| 309 &CapabilitiesParser::ParseProxyAutoDetect; | 310 &CapabilitiesParser::ParseProxyAutoDetect; |
| 310 proxy_type_parser_map["pac"] = | 311 proxy_type_parser_map["pac"] = |
| 311 &CapabilitiesParser::ParseProxyAutoconfigUrl; | 312 &CapabilitiesParser::ParseProxyAutoconfigUrl; |
| 312 proxy_type_parser_map["manual"] = &CapabilitiesParser::ParseProxyServers; | 313 proxy_type_parser_map["manual"] = &CapabilitiesParser::ParseProxyServers; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 if (!switches->GetString(i, &switch_name)) { | 444 if (!switches->GetString(i, &switch_name)) { |
| 444 return new Error(kBadRequest, | 445 return new Error(kBadRequest, |
| 445 "Each switch to be removed must be a string"); | 446 "Each switch to be removed must be a string"); |
| 446 } | 447 } |
| 447 caps_->exclude_switches.insert(switch_name); | 448 caps_->exclude_switches.insert(switch_name); |
| 448 } | 449 } |
| 449 return NULL; | 450 return NULL; |
| 450 } | 451 } |
| 451 | 452 |
| 452 } // namespace webdriver | 453 } // namespace webdriver |
| OLD | NEW |