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

Unified Diff: chrome/test/chromedriver/window_commands.cc

Issue 22263003: [chromedriver] Implement touch down, up, and move commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/window_commands.cc
diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc
index cec74796246a2c03e592455ad658d9a733dc3cf9..0e3d52fa9f2a66ea3249d7d6ef0f17be84fa315e 100644
--- a/chrome/test/chromedriver/window_commands.cc
+++ b/chrome/test/chromedriver/window_commands.cc
@@ -499,6 +499,57 @@ Status ExecuteMouseDoubleClick(
return web_view->DispatchMouseEvents(events, session->GetCurrentFrameId());
}
+Status ExecuteTouchDown(
+ Session* session,
+ WebView* web_view,
+ const base::DictionaryValue& params,
+ scoped_ptr<base::Value>* value) {
+ int x, y;
+ if (!params.GetInteger("x", &x))
+ return Status(kUnknownError, "'x' must be an integer");
+ if (!params.GetInteger("y", &y))
+ return Status(kUnknownError, "'y' must be an integer");
+
+ std::list<TouchEvent> events;
+ events.push_back(
+ TouchEvent(kTouchStart, x, y));
+ return web_view->DispatchTouchEvents(events);
+}
+
+Status ExecuteTouchUp(
+ Session* session,
+ WebView* web_view,
+ const base::DictionaryValue& params,
+ scoped_ptr<base::Value>* value) {
+ int x, y;
+ if (!params.GetInteger("x", &x))
+ return Status(kUnknownError, "'x' must be an integer");
+ if (!params.GetInteger("y", &y))
+ return Status(kUnknownError, "'y' must be an integer");
+
+ std::list<TouchEvent> events;
+ events.push_back(
+ TouchEvent(kTouchEnd, x, y));
+ return web_view->DispatchTouchEvents(events);
+}
+
+Status ExecuteTouchMove(
+ Session* session,
+ WebView* web_view,
+ const base::DictionaryValue& params,
+ scoped_ptr<base::Value>* value) {
+ int x, y;
+ if (!params.GetInteger("x", &x))
+ return Status(kUnknownError, "'x' must be an integer");
+ if (!params.GetInteger("y", &y))
+ return Status(kUnknownError, "'y' must be an integer");
+
+ std::list<TouchEvent> events;
+ events.push_back(
+ TouchEvent(kTouchMove, x, y));
+ return web_view->DispatchTouchEvents(events);
+}
+
Status ExecuteGetActiveElement(
Session* session,
WebView* web_view,
« chrome/test/chromedriver/test_expectations ('K') | « chrome/test/chromedriver/window_commands.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698