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> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 std::vector<WebElementId>* elements); | 195 std::vector<WebElementId>* elements); |
196 | 196 |
197 // Scroll the element into view and get its location relative to | 197 // Scroll the element into view and get its location relative to |
198 // the client's viewport. | 198 // the client's viewport. |
199 Error* GetElementLocationInView( | 199 Error* GetElementLocationInView( |
200 const WebElementId& element, | 200 const WebElementId& element, |
201 gfx::Point* location); | 201 gfx::Point* location); |
202 | 202 |
203 // Scroll the element's region into view and get its location relative to | 203 // Scroll the element's region into view and get its location relative to |
204 // the client's viewport. If |center| is true, the element will be centered | 204 // the client's viewport. If |center| is true, the element will be centered |
205 // if it is too big to fit in view. | 205 // if it is too big to fit in view. If |verify_clickable_at_middle| is true, |
206 // an error will be returned if the element is not clickable in the middle | |
207 // of the given region. | |
206 Error* GetElementRegionInView( | 208 Error* GetElementRegionInView( |
207 const WebElementId& element, | 209 const WebElementId& element, |
208 const gfx::Rect& region, | 210 const gfx::Rect& region, |
209 bool center, | 211 bool center, |
212 bool verify_clickable_at_middle, | |
210 gfx::Point* location); | 213 gfx::Point* location); |
211 | 214 |
212 // Gets the size of the element from the given window and frame, even if | 215 // Gets the size of the element from the given window and frame, even if |
213 // its display is none. | 216 // its display is none. |
214 Error* GetElementSize(const FrameId& frame_id, | 217 Error* GetElementSize(const FrameId& frame_id, |
215 const WebElementId& element, | 218 const WebElementId& element, |
216 gfx::Size* size); | 219 gfx::Size* size); |
217 | 220 |
218 // Gets the size of the element's first client rect. If the element has | 221 // Gets the size of the element's first client rect. If the element has |
219 // no client rects, this will return an error. | 222 // no client rects, this will return an error. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
307 void SendKeysOnSessionThread(const string16& keys, Error** error); | 310 void SendKeysOnSessionThread(const string16& keys, Error** error); |
308 Error* SwitchToFrameWithJavaScriptLocatedFrame( | 311 Error* SwitchToFrameWithJavaScriptLocatedFrame( |
309 const std::string& script, | 312 const std::string& script, |
310 base::ListValue* args); | 313 base::ListValue* args); |
311 Error* FindElementsHelper(const FrameId& frame_id, | 314 Error* FindElementsHelper(const FrameId& frame_id, |
312 const WebElementId& root_element, | 315 const WebElementId& root_element, |
313 const std::string& locator, | 316 const std::string& locator, |
314 const std::string& query, | 317 const std::string& query, |
315 bool find_one, | 318 bool find_one, |
316 std::vector<WebElementId>* elements); | 319 std::vector<WebElementId>* elements); |
320 Error* VerifyElementIsClickable( | |
Huyen
2011/07/27 22:23:23
Maybe add comments stating an error is returned if
kkania
2011/07/28 16:44:08
Done.
| |
321 const FrameId& frame_id, | |
322 const WebElementId& element, | |
323 const gfx::Point& location); | |
317 Error* GetElementRegionInViewHelper( | 324 Error* GetElementRegionInViewHelper( |
318 const FrameId& frame_id, | 325 const FrameId& frame_id, |
319 const WebElementId& element, | 326 const WebElementId& element, |
320 const gfx::Rect& region, | 327 const gfx::Rect& region, |
321 bool center, | 328 bool center, |
329 bool verify_clickable_at_middle, | |
322 gfx::Point* location); | 330 gfx::Point* location); |
323 | 331 |
324 const std::string id_; | 332 const std::string id_; |
325 FrameId current_target_; | 333 FrameId current_target_; |
326 | 334 |
327 scoped_ptr<Automation> automation_; | 335 scoped_ptr<Automation> automation_; |
328 base::Thread thread_; | 336 base::Thread thread_; |
329 | 337 |
330 // Timeout (in ms) for asynchronous script execution. | 338 // Timeout (in ms) for asynchronous script execution. |
331 int async_script_timeout_; | 339 int async_script_timeout_; |
(...skipping 27 matching lines...) Expand all Loading... | |
359 bool has_alert_prompt_text_; | 367 bool has_alert_prompt_text_; |
360 | 368 |
361 DISALLOW_COPY_AND_ASSIGN(Session); | 369 DISALLOW_COPY_AND_ASSIGN(Session); |
362 }; | 370 }; |
363 | 371 |
364 } // namespace webdriver | 372 } // namespace webdriver |
365 | 373 |
366 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); | 374 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); |
367 | 375 |
368 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ | 376 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ |
OLD | NEW |