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

Unified Diff: content/shell/renderer/test_runner/event_sender.cc

Issue 729533003: Remove GestureScrollUpdateWithoutPropagation event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove hard count from the test Created 6 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
Index: content/shell/renderer/test_runner/event_sender.cc
diff --git a/content/shell/renderer/test_runner/event_sender.cc b/content/shell/renderer/test_runner/event_sender.cc
index 695750319c5c9265a2dd494a415c0337d48d517e..bdeec7fa2167851c48941ead0f2f280b9303f93a 100644
--- a/content/shell/renderer/test_runner/event_sender.cc
+++ b/content/shell/renderer/test_runner/event_sender.cc
@@ -386,6 +386,8 @@ class EventSenderBindings : public gin::Wrappable<EventSenderBindings> {
void GestureScrollBegin(gin::Arguments* args);
void GestureScrollEnd(gin::Arguments* args);
void GestureScrollUpdate(gin::Arguments* args);
+ //TODO: Remove GestureScrollUpdateWithoutPropagation once CL 732483003 has
+ // landed
void GestureScrollUpdateWithoutPropagation(gin::Arguments* args);
void GestureTap(gin::Arguments* args);
void GestureTapDown(gin::Arguments* args);
@@ -1746,7 +1748,7 @@ void EventSender::GestureScrollUpdate(gin::Arguments* args) {
}
void EventSender::GestureScrollUpdateWithoutPropagation(gin::Arguments* args) {
- GestureEvent(WebInputEvent::GestureScrollUpdateWithoutPropagation, args);
+ GestureEvent(WebInputEvent::GestureScrollUpdate, args, true);
}
void EventSender::GestureTap(gin::Arguments* args) {
@@ -1950,8 +1952,10 @@ void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type) {
}
}
+//TODO Remove preventPropagation from arguments once CL 732483003 has landed
void EventSender::GestureEvent(WebInputEvent::Type type,
- gin::Arguments* args) {
+ gin::Arguments* args,
+ bool preventPropagation) {
double x;
double y;
if (!args->GetNext(&x) || !args->GetNext(&y)) {
@@ -1964,9 +1968,17 @@ void EventSender::GestureEvent(WebInputEvent::Type type,
switch (type) {
case WebInputEvent::GestureScrollUpdate:
- case WebInputEvent::GestureScrollUpdateWithoutPropagation:
+ {
+ if (!preventPropagation && !args->PeekNext().IsEmpty()) {
+ if (!args->GetNext(&preventPropagation)) {
+ args->ThrowError();
+ return;
+ }
+ }
+
event.data.scrollUpdate.deltaX = static_cast<float>(x);
event.data.scrollUpdate.deltaY = static_cast<float>(y);
+ event.data.scrollUpdate.preventPropagation = preventPropagation;
event.x = current_gesture_location_.x;
event.y = current_gesture_location_.y;
current_gesture_location_.x =
@@ -1974,6 +1986,7 @@ void EventSender::GestureEvent(WebInputEvent::Type type,
current_gesture_location_.y =
current_gesture_location_.y + event.data.scrollUpdate.deltaY;
break;
+ }
case WebInputEvent::GestureScrollBegin:
current_gesture_location_ = WebPoint(x, y);
event.x = current_gesture_location_.x;
« no previous file with comments | « content/shell/renderer/test_runner/event_sender.h ('k') | content/shell/renderer/test_runner/test_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698