Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/test/webdriver/session.h

Issue 7465053: In chromedriver, check if an element is clickable before clicking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « DEPS ('k') | chrome/test/webdriver/session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 // Returns an error if the element is not clickable.
321 Error* VerifyElementIsClickable(
322 const FrameId& frame_id,
323 const WebElementId& element,
324 const gfx::Point& location);
317 Error* GetElementRegionInViewHelper( 325 Error* GetElementRegionInViewHelper(
318 const FrameId& frame_id, 326 const FrameId& frame_id,
319 const WebElementId& element, 327 const WebElementId& element,
320 const gfx::Rect& region, 328 const gfx::Rect& region,
321 bool center, 329 bool center,
330 bool verify_clickable_at_middle,
322 gfx::Point* location); 331 gfx::Point* location);
323 332
324 const std::string id_; 333 const std::string id_;
325 FrameId current_target_; 334 FrameId current_target_;
326 335
327 scoped_ptr<Automation> automation_; 336 scoped_ptr<Automation> automation_;
328 base::Thread thread_; 337 base::Thread thread_;
329 338
330 // Timeout (in ms) for asynchronous script execution. 339 // Timeout (in ms) for asynchronous script execution.
331 int async_script_timeout_; 340 int async_script_timeout_;
(...skipping 27 matching lines...) Expand all
359 bool has_alert_prompt_text_; 368 bool has_alert_prompt_text_;
360 369
361 DISALLOW_COPY_AND_ASSIGN(Session); 370 DISALLOW_COPY_AND_ASSIGN(Session);
362 }; 371 };
363 372
364 } // namespace webdriver 373 } // namespace webdriver
365 374
366 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); 375 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session);
367 376
368 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ 377 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_
OLDNEW
« no previous file with comments | « DEPS ('k') | chrome/test/webdriver/session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698