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

Unified Diff: chrome/test/webdriver/commands/mouse_commands.cc

Issue 7522024: Refactor chromedriver's script execution to reduce amount of custom Value parsing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/webdriver/commands/mouse_commands.cc
diff --git a/chrome/test/webdriver/commands/mouse_commands.cc b/chrome/test/webdriver/commands/mouse_commands.cc
index 0a8724d66b993acdf6d084ac9b900fb85e52ec5c..d00cdfe8aecdf501a5c6b77a193a3fe5c4a23a29 100644
--- a/chrome/test/webdriver/commands/mouse_commands.cc
+++ b/chrome/test/webdriver/commands/mouse_commands.cc
@@ -9,9 +9,8 @@
#include "chrome/test/webdriver/commands/response.h"
#include "chrome/test/webdriver/session.h"
#include "chrome/test/webdriver/web_element_id.h"
+#include "chrome/test/webdriver/webdriver_basic_types.h"
#include "chrome/test/webdriver/webdriver_error.h"
-#include "ui/gfx/point.h"
-#include "ui/gfx/size.h"
namespace {
@@ -46,7 +45,7 @@ void MoveAndClickCommand::ExecutePost(Response* response) {
if (tag_name == "option") {
error = session_->SelectOptionElement(session_->current_target(), element);
} else {
- gfx::Point location;
+ Point location;
error = session_->GetClickableLocation(element, &location);
if (!error)
error = session_->MouseMoveAndClick(location, automation::kLeftButton);
@@ -69,7 +68,7 @@ bool HoverCommand::DoesPost() {
void HoverCommand::ExecutePost(Response* response) {
Error* error = NULL;
- gfx::Point location;
+ Point location;
error = session_->GetClickableLocation(element, &location);
if (!error)
error = session_->MouseMove(location);
@@ -104,14 +103,14 @@ bool DragCommand::DoesPost() {
void DragCommand::ExecutePost(Response* response) {
Error* error = NULL;
- gfx::Point drag_from;
+ Point drag_from;
error = session_->GetClickableLocation(element, &drag_from);
if (error) {
response->SetError(error);
return;
}
- gfx::Point drag_to(drag_from);
+ Point drag_to(drag_from);
drag_to.Offset(drag_x_, drag_y_);
if (drag_to.x() < 0 || drag_to.y() < 0)
error = new Error(kBadRequest, "Invalid (x,y) coordinates");
@@ -167,7 +166,7 @@ bool MoveToCommand::Init(Response* const response) {
}
void MoveToCommand::ExecutePost(Response* const response) {
- gfx::Point location;
+ Point location;
Error* error;
if (has_element_) {
@@ -189,7 +188,7 @@ void MoveToCommand::ExecutePost(Response* const response) {
DCHECK(has_element_);
// If not, calculate the half of the element size and translate by it.
- gfx::Size size;
+ Size size;
error = session_->GetElementSize(session_->current_target(),
element_, &size);
if (error) {

Powered by Google App Engine
This is Rietveld 408576698