OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEBDRIVER_WEBDRIVER_AUTOMATION_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_WEBDRIVER_AUTOMATION_H_ |
6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_AUTOMATION_H_ | 6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_AUTOMATION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Creates and controls the Chrome instance. | 35 // Creates and controls the Chrome instance. |
36 // This class should be created and accessed on a single thread. | 36 // This class should be created and accessed on a single thread. |
37 // Note: All member functions are void because they are invoked | 37 // Note: All member functions are void because they are invoked |
38 // by posting a task from NewRunnableMethod. | 38 // by posting a task from NewRunnableMethod. |
39 class Automation { | 39 class Automation { |
40 public: | 40 public: |
41 struct BrowserOptions { | 41 struct BrowserOptions { |
42 BrowserOptions(); | 42 BrowserOptions(); |
43 ~BrowserOptions(); | 43 ~BrowserOptions(); |
44 | 44 |
| 45 // The command line to use for launching the browser. If no program is |
| 46 // specified, the default browser executable will be used. |
45 CommandLine command; | 47 CommandLine command; |
| 48 |
| 49 // The user data directory to be copied and used. If empty, a temporary |
| 50 // directory will be used. |
46 FilePath user_data_dir; | 51 FilePath user_data_dir; |
| 52 |
| 53 // The channel ID of an already running browser to connect to. If empty, |
| 54 // the browser will be launched with an anonymous channel. |
47 std::string channel_id; | 55 std::string channel_id; |
| 56 |
| 57 // True if the Chrome process should only be terminated if quit is called. |
| 58 // If false, Chrome will also be terminated if this process is killed or |
| 59 // shutdown. |
| 60 bool detach_process; |
48 }; | 61 }; |
49 | 62 |
50 Automation(); | 63 Automation(); |
51 virtual ~Automation(); | 64 virtual ~Automation(); |
52 | 65 |
53 // Start the system's default Chrome binary. | 66 // Start the system's default Chrome binary. |
54 void Init(const BrowserOptions& options, Error** error); | 67 void Init(const BrowserOptions& options, Error** error); |
55 | 68 |
56 // Terminates this session and disconnects its automation proxy. After | 69 // Terminates this session and disconnects its automation proxy. After |
57 // invoking this method, the Automation can safely be deleted. | 70 // invoking this method, the Automation can safely be deleted. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 scoped_ptr<ProxyLauncher> launcher_; | 179 scoped_ptr<ProxyLauncher> launcher_; |
167 | 180 |
168 DISALLOW_COPY_AND_ASSIGN(Automation); | 181 DISALLOW_COPY_AND_ASSIGN(Automation); |
169 }; | 182 }; |
170 | 183 |
171 } // namespace webdriver | 184 } // namespace webdriver |
172 | 185 |
173 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Automation); | 186 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Automation); |
174 | 187 |
175 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_AUTOMATION_H_ | 188 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_AUTOMATION_H_ |
OLD | NEW |