| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/test/chromedriver/capabilities.h" | 5 #include "chrome/test/chromedriver/capabilities.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return Status(kOk); | 178 return Status(kOk); |
| 179 } | 179 } |
| 180 | 180 |
| 181 Status ParseProxy(const base::Value& option, Capabilities* capabilities) { | 181 Status ParseProxy(const base::Value& option, Capabilities* capabilities) { |
| 182 const base::DictionaryValue* proxy_dict; | 182 const base::DictionaryValue* proxy_dict; |
| 183 if (!option.GetAsDictionary(&proxy_dict)) | 183 if (!option.GetAsDictionary(&proxy_dict)) |
| 184 return Status(kUnknownError, "must be a dictionary"); | 184 return Status(kUnknownError, "must be a dictionary"); |
| 185 std::string proxy_type; | 185 std::string proxy_type; |
| 186 if (!proxy_dict->GetString("proxyType", &proxy_type)) | 186 if (!proxy_dict->GetString("proxyType", &proxy_type)) |
| 187 return Status(kUnknownError, "'proxyType' must be a string"); | 187 return Status(kUnknownError, "'proxyType' must be a string"); |
| 188 proxy_type = StringToLowerASCII(proxy_type); | 188 proxy_type = base::StringToLowerASCII(proxy_type); |
| 189 if (proxy_type == "direct") { | 189 if (proxy_type == "direct") { |
| 190 capabilities->switches.SetSwitch("no-proxy-server"); | 190 capabilities->switches.SetSwitch("no-proxy-server"); |
| 191 } else if (proxy_type == "system") { | 191 } else if (proxy_type == "system") { |
| 192 // Chrome default. | 192 // Chrome default. |
| 193 } else if (proxy_type == "pac") { | 193 } else if (proxy_type == "pac") { |
| 194 CommandLine::StringType proxy_pac_url; | 194 CommandLine::StringType proxy_pac_url; |
| 195 if (!proxy_dict->GetString("proxyAutoconfigUrl", &proxy_pac_url)) | 195 if (!proxy_dict->GetString("proxyAutoconfigUrl", &proxy_pac_url)) |
| 196 return Status(kUnknownError, "'proxyAutoconfigUrl' must be a string"); | 196 return Status(kUnknownError, "'proxyAutoconfigUrl' must be a string"); |
| 197 capabilities->switches.SetSwitch("proxy-pac-url", proxy_pac_url); | 197 capabilities->switches.SetSwitch("proxy-pac-url", proxy_pac_url); |
| 198 } else if (proxy_type == "autodetect") { | 198 } else if (proxy_type == "autodetect") { |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 if (iter == logging_prefs.end() || iter->second == Log::kOff) { | 563 if (iter == logging_prefs.end() || iter->second == Log::kOff) { |
| 564 const base::DictionaryValue* chrome_options = NULL; | 564 const base::DictionaryValue* chrome_options = NULL; |
| 565 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) && | 565 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) && |
| 566 chrome_options->HasKey("perfLoggingPrefs")) { | 566 chrome_options->HasKey("perfLoggingPrefs")) { |
| 567 return Status(kUnknownError, "perfLoggingPrefs specified, " | 567 return Status(kUnknownError, "perfLoggingPrefs specified, " |
| 568 "but performance logging was not enabled"); | 568 "but performance logging was not enabled"); |
| 569 } | 569 } |
| 570 } | 570 } |
| 571 return Status(kOk); | 571 return Status(kOk); |
| 572 } | 572 } |
| OLD | NEW |