Update CrOS OOBE throbber to MD throbber; delete old asset
[chromium-blink-merge.git] / chrome / test / chromedriver / element_commands.h
blob146f28afca198037f15f063994a8fa311da370b2
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
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_CHROMEDRIVER_ELEMENT_COMMANDS_H_
6 #define CHROME_TEST_CHROMEDRIVER_ELEMENT_COMMANDS_H_
8 #include <string>
10 #include "base/callback_forward.h"
11 #include "base/memory/scoped_ptr.h"
13 namespace base {
14 class DictionaryValue;
15 class Value;
18 struct Session;
19 class Status;
20 class WebView;
22 typedef base::Callback<Status(
23 Session* session,
24 WebView* web_view,
25 const std::string&,
26 const base::DictionaryValue&,
27 scoped_ptr<base::Value>*)> ElementCommand;
29 // Execute a command on a specific element.
30 Status ExecuteElementCommand(
31 const ElementCommand& command,
32 Session* session,
33 WebView* web_view,
34 const base::DictionaryValue& params,
35 scoped_ptr<base::Value>* value);
37 // Search for an element on the page, starting from the given element.
38 Status ExecuteFindChildElement(
39 int interval_ms,
40 Session* session,
41 WebView* web_view,
42 const std::string& element_id,
43 const base::DictionaryValue& params,
44 scoped_ptr<base::Value>* value);
46 // Search for multiple elements on the page, starting from the given element.
47 Status ExecuteFindChildElements(
48 int interval_ms,
49 Session* session,
50 WebView* web_view,
51 const std::string& element_id,
52 const base::DictionaryValue& params,
53 scoped_ptr<base::Value>* value);
55 // Move the mouse to the given element.
56 Status ExecuteHoverOverElement(
57 Session* session,
58 WebView* web_view,
59 const std::string& element_id,
60 const base::DictionaryValue& params,
61 scoped_ptr<base::Value>* value);
63 // Click on the element.
64 Status ExecuteClickElement(
65 Session* session,
66 WebView* web_view,
67 const std::string& element_id,
68 const base::DictionaryValue& params,
69 scoped_ptr<base::Value>* value);
71 // Touch click on the element.
72 Status ExecuteTouchSingleTap(
73 Session* session,
74 WebView* web_view,
75 const std::string& element_id,
76 const base::DictionaryValue& params,
77 scoped_ptr<base::Value>* value);
79 // Double tap on the element.
80 Status ExecuteTouchDoubleTap(
81 Session* session,
82 WebView* web_view,
83 const std::string& element_id,
84 const base::DictionaryValue& params,
85 scoped_ptr<base::Value>* value);
87 // Long press on the element.
88 Status ExecuteTouchLongPress(
89 Session* session,
90 WebView* web_view,
91 const std::string& element_id,
92 const base::DictionaryValue& params,
93 scoped_ptr<base::Value>* value);
95 // Touch flick starting on the element.
96 Status ExecuteFlick(
97 Session* session,
98 WebView* web_view,
99 const std::string& element_id,
100 const base::DictionaryValue& params,
101 scoped_ptr<base::Value>* value);
103 // Clear a TEXTAREA or text INPUT element's value.
104 Status ExecuteClearElement(
105 Session* session,
106 WebView* web_view,
107 const std::string& element_id,
108 const base::DictionaryValue& params,
109 scoped_ptr<base::Value>* value);
111 // Send a sequence of key strokes to an element.
112 Status ExecuteSendKeysToElement(
113 Session* session,
114 WebView* web_view,
115 const std::string& element_id,
116 const base::DictionaryValue& params,
117 scoped_ptr<base::Value>* value);
119 // Submit a form element.
120 Status ExecuteSubmitElement(
121 Session* session,
122 WebView* web_view,
123 const std::string& element_id,
124 const base::DictionaryValue& params,
125 scoped_ptr<base::Value>* value);
127 // Returns the text of a given element.
128 Status ExecuteGetElementText(
129 Session* session,
130 WebView* web_view,
131 const std::string& element_id,
132 const base::DictionaryValue& params,
133 scoped_ptr<base::Value>* value);
135 // Returns the value of a given element.
136 Status ExecuteGetElementValue(
137 Session* session,
138 WebView* web_view,
139 const std::string& element_id,
140 const base::DictionaryValue& params,
141 scoped_ptr<base::Value>* value);
143 // Returns the lower case tag name of a given element.
144 Status ExecuteGetElementTagName(
145 Session* session,
146 WebView* web_view,
147 const std::string& element_id,
148 const base::DictionaryValue& params,
149 scoped_ptr<base::Value>* value);
151 Status ExecuteIsElementSelected(
152 Session* session,
153 WebView* web_view,
154 const std::string& element_id,
155 const base::DictionaryValue& params,
156 scoped_ptr<base::Value>* value);
158 Status ExecuteIsElementEnabled(
159 Session* session,
160 WebView* web_view,
161 const std::string& element_id,
162 const base::DictionaryValue& params,
163 scoped_ptr<base::Value>* value);
165 Status ExecuteIsElementDisplayed(
166 Session* session,
167 WebView* web_view,
168 const std::string& element_id,
169 const base::DictionaryValue& params,
170 scoped_ptr<base::Value>* value);
172 // Returns the location of a given element in page coordinates.
173 Status ExecuteGetElementLocation(
174 Session* session,
175 WebView* web_view,
176 const std::string& element_id,
177 const base::DictionaryValue& params,
178 scoped_ptr<base::Value>* value);
180 // Returns the location of a given element in client coordinates, after
181 // scrolling it into view.
182 Status ExecuteGetElementLocationOnceScrolledIntoView(
183 Session* session,
184 WebView* web_view,
185 const std::string& element_id,
186 const base::DictionaryValue& params,
187 scoped_ptr<base::Value>* value);
189 Status ExecuteGetElementSize(
190 Session* session,
191 WebView* web_view,
192 const std::string& element_id,
193 const base::DictionaryValue& params,
194 scoped_ptr<base::Value>* value);
196 Status ExecuteGetElementAttribute(
197 Session* session,
198 WebView* web_view,
199 const std::string& element_id,
200 const base::DictionaryValue& params,
201 scoped_ptr<base::Value>* value);
203 // Returns the effective style for a given property of the specified element.
204 Status ExecuteGetElementValueOfCSSProperty(
205 Session* session,
206 WebView* web_view,
207 const std::string& element_id,
208 const base::DictionaryValue& params,
209 scoped_ptr<base::Value>* value);
211 // Returns whether the two given elements are equivalent.
212 Status ExecuteElementEquals(
213 Session* session,
214 WebView* web_view,
215 const std::string& element_id,
216 const base::DictionaryValue& params,
217 scoped_ptr<base::Value>* value);
219 #endif // CHROME_TEST_CHROMEDRIVER_ELEMENT_COMMANDS_H_