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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return Status(kOk); | 204 return Status(kOk); |
205 } | 205 } |
206 | 206 |
207 Status ParseProxy(const base::Value& option, Capabilities* capabilities) { | 207 Status ParseProxy(const base::Value& option, Capabilities* capabilities) { |
208 const base::DictionaryValue* proxy_dict; | 208 const base::DictionaryValue* proxy_dict; |
209 if (!option.GetAsDictionary(&proxy_dict)) | 209 if (!option.GetAsDictionary(&proxy_dict)) |
210 return Status(kUnknownError, "must be a dictionary"); | 210 return Status(kUnknownError, "must be a dictionary"); |
211 std::string proxy_type; | 211 std::string proxy_type; |
212 if (!proxy_dict->GetString("proxyType", &proxy_type)) | 212 if (!proxy_dict->GetString("proxyType", &proxy_type)) |
213 return Status(kUnknownError, "'proxyType' must be a string"); | 213 return Status(kUnknownError, "'proxyType' must be a string"); |
214 proxy_type = base::StringToLowerASCII(proxy_type); | 214 proxy_type = base::ToLowerASCII(proxy_type); |
215 if (proxy_type == "direct") { | 215 if (proxy_type == "direct") { |
216 capabilities->switches.SetSwitch("no-proxy-server"); | 216 capabilities->switches.SetSwitch("no-proxy-server"); |
217 } else if (proxy_type == "system") { | 217 } else if (proxy_type == "system") { |
218 // Chrome default. | 218 // Chrome default. |
219 } else if (proxy_type == "pac") { | 219 } else if (proxy_type == "pac") { |
220 base::CommandLine::StringType proxy_pac_url; | 220 base::CommandLine::StringType proxy_pac_url; |
221 if (!proxy_dict->GetString("proxyAutoconfigUrl", &proxy_pac_url)) | 221 if (!proxy_dict->GetString("proxyAutoconfigUrl", &proxy_pac_url)) |
222 return Status(kUnknownError, "'proxyAutoconfigUrl' must be a string"); | 222 return Status(kUnknownError, "'proxyAutoconfigUrl' must be a string"); |
223 capabilities->switches.SetSwitch("proxy-pac-url", proxy_pac_url); | 223 capabilities->switches.SetSwitch("proxy-pac-url", proxy_pac_url); |
224 } else if (proxy_type == "autodetect") { | 224 } else if (proxy_type == "autodetect") { |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 if (iter == logging_prefs.end() || iter->second == Log::kOff) { | 593 if (iter == logging_prefs.end() || iter->second == Log::kOff) { |
594 const base::DictionaryValue* chrome_options = NULL; | 594 const base::DictionaryValue* chrome_options = NULL; |
595 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) && | 595 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) && |
596 chrome_options->HasKey("perfLoggingPrefs")) { | 596 chrome_options->HasKey("perfLoggingPrefs")) { |
597 return Status(kUnknownError, "perfLoggingPrefs specified, " | 597 return Status(kUnknownError, "perfLoggingPrefs specified, " |
598 "but performance logging was not enabled"); | 598 "but performance logging was not enabled"); |
599 } | 599 } |
600 } | 600 } |
601 return Status(kOk); | 601 return Status(kOk); |
602 } | 602 } |
OLD | NEW |