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 <set> | 9 #include <set> |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/strings/string16.h" | |
15 | 17 |
16 namespace base { | 18 namespace base { |
17 class DictionaryValue; | 19 class DictionaryValue; |
18 } | 20 } |
19 | 21 |
22 class CommandLine; | |
20 class Log; | 23 class Log; |
21 class Status; | 24 class Status; |
22 | 25 |
26 class Switches { | |
27 public: | |
28 typedef base::FilePath::StringType NativeString; | |
29 Switches(); | |
30 ~Switches(); | |
31 | |
32 void SetSwitch(const std::string& name); | |
33 void SetSwitch(const std::string& name, const std::string& value); | |
34 void SetSwitch(const std::string& name, const string16& value); | |
35 void SetSwitch(const std::string& name, const base::FilePath& value); | |
36 | |
37 void SetUnparsedSwitch(const std::string& unparsed_switch); | |
chrisgao (Use stgao instead)
2013/08/29 22:53:32
Add a comment on its difference from those above?
kkania
2013/08/30 03:14:57
Done.
| |
38 | |
39 bool HasSwitch(const std::string& name) const; | |
40 std::string GetSwitchValue(const std::string& name) const; | |
41 NativeString GetSwitchValueNative(const std::string& name) const; | |
42 | |
43 size_t GetSize() const; | |
44 | |
45 void AppendToCommandLine(CommandLine* command) const; | |
46 std::string ToString() const; | |
47 | |
48 private: | |
49 typedef std::map<std::string, NativeString> SwitchMap; | |
50 SwitchMap switch_map_; | |
51 }; | |
52 | |
23 struct Capabilities { | 53 struct Capabilities { |
24 Capabilities(); | 54 Capabilities(); |
25 ~Capabilities(); | 55 ~Capabilities(); |
26 | 56 |
27 // Return true if existing host:port session is to be used. | 57 // Return true if existing host:port session is to be used. |
28 bool IsExistingBrowser() const; | 58 bool IsExistingBrowser() const; |
29 | 59 |
30 // Return true if android package is specified. | 60 // Return true if android package is specified. |
31 bool IsAndroid() const; | 61 bool IsAndroid() const; |
32 | 62 |
33 Status Parse(const base::DictionaryValue& desired_caps, Log* log); | 63 Status Parse(const base::DictionaryValue& desired_caps, Log* log); |
34 | 64 |
35 // True if should always use DevTools for taking screenshots. | 65 // True if should always use DevTools for taking screenshots. |
36 // This is experimental and may be removed at a later point. | 66 // This is experimental and may be removed at a later point. |
37 bool force_devtools_screenshot; | 67 bool force_devtools_screenshot; |
38 | 68 |
39 // Whether the lifetime of the started Chrome browser process should be | 69 // Whether the lifetime of the started Chrome browser process should be |
40 // bound to ChromeDriver's process. If true, Chrome will not quit if | 70 // bound to ChromeDriver's process. If true, Chrome will not quit if |
41 // ChromeDriver dies. | 71 // ChromeDriver dies. |
42 bool detach; | 72 bool detach; |
43 | 73 |
44 // If provided, the remote debugging port on 127.0.0.1 to connect to. | 74 // If provided, the remote debugging port on 127.0.0.1 to connect to. |
45 int existing_browser_port; | 75 int existing_browser_port; |
46 | 76 |
47 std::string android_package; | 77 std::string android_package; |
48 std::string android_activity; | 78 std::string android_activity; |
49 std::string android_process; | 79 std::string android_process; |
50 std::string android_device_serial; | 80 std::string android_device_serial; |
51 std::string android_args; | |
52 | 81 |
82 base::FilePath binary; | |
53 std::string log_path; | 83 std::string log_path; |
54 CommandLine command; | |
55 scoped_ptr<base::DictionaryValue> prefs; | 84 scoped_ptr<base::DictionaryValue> prefs; |
56 scoped_ptr<base::DictionaryValue> local_state; | 85 scoped_ptr<base::DictionaryValue> local_state; |
57 std::vector<std::string> extensions; | 86 std::vector<std::string> extensions; |
58 scoped_ptr<base::DictionaryValue> logging_prefs; | 87 scoped_ptr<base::DictionaryValue> logging_prefs; |
59 | 88 |
60 // Set of switches which should be removed from default list when launching | 89 // Set of switches which should be removed from default list when launching |
61 // Chrome. | 90 // Chrome. |
62 std::set<std::string> exclude_switches; | 91 std::set<std::string> exclude_switches; |
chrisgao (Use stgao instead)
2013/08/29 22:53:32
exclude_switches has no effect anymore?
kkania
2013/08/30 03:14:57
Done.
| |
92 | |
93 Switches switches; | |
63 }; | 94 }; |
64 | 95 |
65 #endif // CHROME_TEST_CHROMEDRIVER_CAPABILITIES_H_ | 96 #endif // CHROME_TEST_CHROMEDRIVER_CAPABILITIES_H_ |
OLD | NEW |