| 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 #ifndef CHROME_TEST_CHROMEDRIVER_CAPABILITIES_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_CAPABILITIES_H_ |
| 6 #define CHROME_TEST_CHROMEDRIVER_CAPABILITIES_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_CAPABILITIES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 17 #include "chrome/test/chromedriver/chrome/log.h" | 17 #include "chrome/test/chromedriver/chrome/log.h" |
| 18 #include "chrome/test/chromedriver/net/net_util.h" | 18 #include "chrome/test/chromedriver/net/net_util.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class CommandLine; |
| 21 class DictionaryValue; | 22 class DictionaryValue; |
| 22 } | 23 } |
| 23 | 24 |
| 24 class CommandLine; | |
| 25 class Status; | 25 class Status; |
| 26 | 26 |
| 27 class Switches { | 27 class Switches { |
| 28 public: | 28 public: |
| 29 typedef base::FilePath::StringType NativeString; | 29 typedef base::FilePath::StringType NativeString; |
| 30 Switches(); | 30 Switches(); |
| 31 ~Switches(); | 31 ~Switches(); |
| 32 | 32 |
| 33 void SetSwitch(const std::string& name); | 33 void SetSwitch(const std::string& name); |
| 34 void SetSwitch(const std::string& name, const std::string& value); | 34 void SetSwitch(const std::string& name, const std::string& value); |
| 35 void SetSwitch(const std::string& name, const base::string16& value); | 35 void SetSwitch(const std::string& name, const base::string16& value); |
| 36 void SetSwitch(const std::string& name, const base::FilePath& value); | 36 void SetSwitch(const std::string& name, const base::FilePath& value); |
| 37 | 37 |
| 38 // In case of same key, |switches| will override. | 38 // In case of same key, |switches| will override. |
| 39 void SetFromSwitches(const Switches& switches); | 39 void SetFromSwitches(const Switches& switches); |
| 40 | 40 |
| 41 // Sets a switch from the capabilities, of the form [--]name[=value]. | 41 // Sets a switch from the capabilities, of the form [--]name[=value]. |
| 42 void SetUnparsedSwitch(const std::string& unparsed_switch); | 42 void SetUnparsedSwitch(const std::string& unparsed_switch); |
| 43 | 43 |
| 44 void RemoveSwitch(const std::string& name); | 44 void RemoveSwitch(const std::string& name); |
| 45 | 45 |
| 46 bool HasSwitch(const std::string& name) const; | 46 bool HasSwitch(const std::string& name) const; |
| 47 std::string GetSwitchValue(const std::string& name) const; | 47 std::string GetSwitchValue(const std::string& name) const; |
| 48 NativeString GetSwitchValueNative(const std::string& name) const; | 48 NativeString GetSwitchValueNative(const std::string& name) const; |
| 49 | 49 |
| 50 size_t GetSize() const; | 50 size_t GetSize() const; |
| 51 | 51 |
| 52 void AppendToCommandLine(CommandLine* command) const; | 52 void AppendToCommandLine(base::CommandLine* command) const; |
| 53 std::string ToString() const; | 53 std::string ToString() const; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 typedef std::map<std::string, NativeString> SwitchMap; | 56 typedef std::map<std::string, NativeString> SwitchMap; |
| 57 SwitchMap switch_map_; | 57 SwitchMap switch_map_; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 typedef std::map<std::string, Log::Level> LoggingPrefs; | 60 typedef std::map<std::string, Log::Level> LoggingPrefs; |
| 61 | 61 |
| 62 struct Capabilities { | 62 struct Capabilities { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // If set, enable minidump for chrome crashes and save to this directory. | 110 // If set, enable minidump for chrome crashes and save to this directory. |
| 111 std::string minidump_path; | 111 std::string minidump_path; |
| 112 | 112 |
| 113 scoped_ptr<base::DictionaryValue> prefs; | 113 scoped_ptr<base::DictionaryValue> prefs; |
| 114 | 114 |
| 115 Switches switches; | 115 Switches switches; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 #endif // CHROME_TEST_CHROMEDRIVER_CAPABILITIES_H_ | 118 #endif // CHROME_TEST_CHROMEDRIVER_CAPABILITIES_H_ |
| OLD | NEW |