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

Unified Diff: webkit/tools/test_shell/event_sending_controller.cc

Issue 4703004: Update the EventSendingController to send complete touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/event_sending_controller.cc
diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc
index d16f6c6dad3a5179da5a21cc7aec6948d04f5d4b..259f3559e2a46d33ffeddb00407d2ee4f59a7ded 100644
--- a/webkit/tools/test_shell/event_sending_controller.cc
+++ b/webkit/tools/test_shell/event_sending_controller.cc
@@ -840,6 +840,7 @@ void EventSendingController::addTouchPoint(
WebTouchPoint touch_point;
touch_point.state = WebTouchPoint::StatePressed;
touch_point.position = WebPoint(args[0].ToInt32(), args[1].ToInt32());
+ touch_point.screenPosition = touch_point.position;
touch_point.id = touch_points.size();
touch_points.push_back(touch_point);
}
@@ -901,6 +902,7 @@ void EventSendingController::updateTouchPoint(
WebTouchPoint* touch_point = &touch_points[index];
touch_point->state = WebTouchPoint::StateMoved;
touch_point->position = position;
+ touch_point->screenPosition = position;
}
void EventSendingController::cancelTouchPoint(
@@ -918,6 +920,12 @@ void EventSendingController::cancelTouchPoint(
void EventSendingController::SendCurrentTouchEvent(
const WebInputEvent::Type type) {
+
+ // Force a layout here just to make sure every position has been
+ // determined before we send events (as well as all the other methods
+ // that send an event do).
jamesr 2010/11/10 19:59:58 Comment isn't very helpful here, recommend removin
+ webview()->layout();
+
if (static_cast<unsigned int>(WebTouchEvent::touchPointsLengthCap) <=
touch_points.size()) {
NOTREACHED() << "Too many touch points for event";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698