Chromium Code Reviews| 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 b113fb7077b2c948cece87a371a7dc2435a93f78..469406f8e25b1cb56be9de5271c3de15879d1846 100644 |
| --- a/content/shell/renderer/test_runner/event_sender.cc |
| +++ b/content/shell/renderer/test_runner/event_sender.cc |
| @@ -396,6 +396,9 @@ class EventSenderBindings : public gin::Wrappable<EventSenderBindings> { |
| void GestureScrollBegin(gin::Arguments* args); |
| void GestureScrollEnd(gin::Arguments* args); |
| void GestureScrollUpdate(gin::Arguments* args); |
| + void GesturePinchBegin(gin::Arguments* args); |
| + void GesturePinchEnd(gin::Arguments* args); |
| + void GesturePinchUpdate(gin::Arguments* args); |
| void GestureTap(gin::Arguments* args); |
| void GestureTapDown(gin::Arguments* args); |
| void GestureShowPress(gin::Arguments* args); |
| @@ -526,6 +529,9 @@ EventSenderBindings::GetObjectTemplateBuilder(v8::Isolate* isolate) { |
| .SetMethod("gestureScrollEnd", &EventSenderBindings::GestureScrollEnd) |
| .SetMethod("gestureScrollUpdate", |
| &EventSenderBindings::GestureScrollUpdate) |
| + .SetMethod("gesturePinchBegin", &EventSenderBindings::GesturePinchBegin) |
| + .SetMethod("gesturePinchEnd", &EventSenderBindings::GesturePinchEnd) |
| + .SetMethod("gesturePinchUpdate", &EventSenderBindings::GesturePinchUpdate) |
| .SetMethod("gestureTap", &EventSenderBindings::GestureTap) |
| .SetMethod("gestureTapDown", &EventSenderBindings::GestureTapDown) |
| .SetMethod("gestureShowPress", &EventSenderBindings::GestureShowPress) |
| @@ -785,6 +791,21 @@ void EventSenderBindings::GestureScrollUpdate(gin::Arguments* args) { |
| sender_->GestureScrollUpdate(args); |
| } |
| +void EventSenderBindings::GesturePinchBegin(gin::Arguments* args) { |
| + if (sender_) |
| + sender_->GesturePinchBegin(args); |
| +} |
| + |
| +void EventSenderBindings::GesturePinchEnd(gin::Arguments* args) { |
| + if (sender_) |
| + sender_->GesturePinchEnd(args); |
| +} |
| + |
| +void EventSenderBindings::GesturePinchUpdate(gin::Arguments* args) { |
| + if (sender_) |
| + sender_->GesturePinchUpdate(args); |
| +} |
| + |
| void EventSenderBindings::GestureTap(gin::Arguments* args) { |
| if (sender_) |
| sender_->GestureTap(args); |
| @@ -1749,6 +1770,18 @@ void EventSender::GestureScrollUpdate(gin::Arguments* args) { |
| GestureEvent(WebInputEvent::GestureScrollUpdate, args); |
| } |
| +void EventSender::GesturePinchBegin(gin::Arguments* args) { |
| + GestureEvent(WebInputEvent::GesturePinchBegin, args); |
| +} |
| + |
| +void EventSender::GesturePinchEnd(gin::Arguments* args) { |
| + GestureEvent(WebInputEvent::GesturePinchEnd, args); |
| +} |
| + |
| +void EventSender::GesturePinchUpdate(gin::Arguments* args) { |
| + GestureEvent(WebInputEvent::GesturePinchUpdate, args); |
| +} |
| + |
| void EventSender::GestureTap(gin::Arguments* args) { |
| GestureEvent(WebInputEvent::GestureTap, args); |
| } |
| @@ -1994,6 +2027,27 @@ void EventSender::GestureEvent(WebInputEvent::Type type, |
| event.x = current_gesture_location_.x; |
| event.y = current_gesture_location_.y; |
| break; |
| + case WebInputEvent::GesturePinchBegin: |
|
Rick Byers
2015/01/29 20:43:27
don't you need a way to specify the source device
ccameron
2015/01/29 21:30:40
Well, I'll want to test that touchscreen events do
|
| + case WebInputEvent::GesturePinchEnd: |
| + current_gesture_location_ = WebPoint(x, y); |
| + event.x = current_gesture_location_.x; |
| + event.y = current_gesture_location_.y; |
| + break; |
| + case WebInputEvent::GesturePinchUpdate: |
| + { |
| + float scale = 1; |
| + if (!args->PeekNext().IsEmpty()) { |
| + if (!args->GetNext(&scale)) { |
| + args->ThrowError(); |
| + return; |
| + } |
| + } |
| + event.data.pinchUpdate.scale = scale; |
| + current_gesture_location_ = WebPoint(x, y); |
| + event.x = current_gesture_location_.x; |
| + event.y = current_gesture_location_.y; |
| + break; |
| + } |
| case WebInputEvent::GestureTap: |
| { |
| float tap_count = 1; |