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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 | 309 |
310 void Switches::SetSwitch(const std::string& name, const std::string& value) { | 310 void Switches::SetSwitch(const std::string& name, const std::string& value) { |
311 #if defined(OS_WIN) | 311 #if defined(OS_WIN) |
312 SetSwitch(name, UTF8ToUTF16(value)); | 312 SetSwitch(name, UTF8ToUTF16(value)); |
313 #else | 313 #else |
314 switch_map_[name] = value; | 314 switch_map_[name] = value; |
315 #endif | 315 #endif |
316 } | 316 } |
317 | 317 |
318 void Switches::SetSwitch(const std::string& name, const string16& value) { | 318 void Switches::SetSwitch(const std::string& name, const base::string16& value) { |
319 #if defined(OS_WIN) | 319 #if defined(OS_WIN) |
320 switch_map_[name] = value; | 320 switch_map_[name] = value; |
321 #else | 321 #else |
322 SetSwitch(name, UTF16ToUTF8(value)); | 322 SetSwitch(name, UTF16ToUTF8(value)); |
323 #endif | 323 #endif |
324 } | 324 } |
325 | 325 |
326 void Switches::SetSwitch(const std::string& name, const base::FilePath& value) { | 326 void Switches::SetSwitch(const std::string& name, const base::FilePath& value) { |
327 SetSwitch(name, value.value()); | 327 SetSwitch(name, value.value()); |
328 } | 328 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 if (desired_caps.Get(it->first, &capability)) { | 432 if (desired_caps.Get(it->first, &capability)) { |
433 Status status = it->second.Run(*capability, this); | 433 Status status = it->second.Run(*capability, this); |
434 if (status.IsError()) { | 434 if (status.IsError()) { |
435 return Status( | 435 return Status( |
436 kUnknownError, "cannot parse capability: " + it->first, status); | 436 kUnknownError, "cannot parse capability: " + it->first, status); |
437 } | 437 } |
438 } | 438 } |
439 } | 439 } |
440 return Status(kOk); | 440 return Status(kOk); |
441 } | 441 } |
OLD | NEW |