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_SESSION_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_SESSION_H_ |
6 #define CHROME_TEST_WEBDRIVER_SESSION_H_ | 6 #define CHROME_TEST_WEBDRIVER_SESSION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "chrome/common/automation_constants.h" |
15 #include "chrome/test/webdriver/automation.h" | 16 #include "chrome/test/webdriver/automation.h" |
16 #include "chrome/test/webdriver/error_codes.h" | 17 #include "chrome/test/webdriver/error_codes.h" |
17 | 18 |
18 class DictionaryValue; | 19 class DictionaryValue; |
19 class FilePath; | 20 class FilePath; |
20 class GURL; | 21 class GURL; |
21 class ListValue; | 22 class ListValue; |
22 class Value; | 23 class Value; |
23 | 24 |
24 namespace base { | 25 namespace base { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 68 |
68 // Same as above, but uses the currently targeted window and frame. | 69 // Same as above, but uses the currently targeted window and frame. |
69 ErrorCode ExecuteScript(const std::string& script, | 70 ErrorCode ExecuteScript(const std::string& script, |
70 const ListValue* const args, | 71 const ListValue* const args, |
71 Value** value); | 72 Value** value); |
72 | 73 |
73 // Send the given keys to the given element dictionary. This function takes | 74 // Send the given keys to the given element dictionary. This function takes |
74 // ownership of |element|. | 75 // ownership of |element|. |
75 ErrorCode SendKeys(const WebElementId& element, const string16& keys); | 76 ErrorCode SendKeys(const WebElementId& element, const string16& keys); |
76 | 77 |
77 // Click events with the mouse should use the values found in: | 78 // Clicks the mouse at the given location using the given button. |
78 // views/events/event.h. In the Webdriver JSON spec the MouseMove | 79 void MouseClick(const gfx::Point& click, automation::MouseButton button); |
79 // function directly maps to the hover command. | |
80 void MouseClick(const gfx::Point& click, int flags); | |
81 bool MouseMove(const gfx::Point& location); | 80 bool MouseMove(const gfx::Point& location); |
82 bool MouseDrag(const gfx::Point& start, const gfx::Point& end); | 81 bool MouseDrag(const gfx::Point& start, const gfx::Point& end); |
83 | 82 |
84 bool NavigateToURL(const std::string& url); | 83 bool NavigateToURL(const std::string& url); |
85 bool GoForward(); | 84 bool GoForward(); |
86 bool GoBack(); | 85 bool GoBack(); |
87 bool Reload(); | 86 bool Reload(); |
88 bool GetURL(GURL* url); | 87 bool GetURL(GURL* url); |
89 bool GetURL(std::string* url); | 88 bool GetURL(std::string* url); |
90 bool GetTabTitle(std::string* tab_title); | 89 bool GetTabTitle(std::string* tab_title); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 int current_window_id_; | 211 int current_window_id_; |
213 | 212 |
214 DISALLOW_COPY_AND_ASSIGN(Session); | 213 DISALLOW_COPY_AND_ASSIGN(Session); |
215 }; | 214 }; |
216 | 215 |
217 } // namespace webdriver | 216 } // namespace webdriver |
218 | 217 |
219 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); | 218 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); |
220 | 219 |
221 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ | 220 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ |
OLD | NEW |