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 1960be99e20fa3f6a35c36f14288099ac31c78e5..8706b8643211bf3ce4311ce42c76519ff9a006de 100644 |
--- a/content/shell/renderer/test_runner/event_sender.cc |
+++ b/content/shell/renderer/test_runner/event_sender.cc |
@@ -417,6 +417,7 @@ class EventSenderBindings : public gin::Wrappable<EventSenderBindings> { |
void GestureTwoFingerTap(gin::Arguments* args); |
void ContinuousMouseScrollBy(gin::Arguments* args); |
void MouseMoveTo(gin::Arguments* args); |
+ void MouseLeave(); |
void TrackpadScrollBegin(); |
void TrackpadScroll(gin::Arguments* args); |
void TrackpadScrollEnd(); |
@@ -554,6 +555,7 @@ EventSenderBindings::GetObjectTemplateBuilder(v8::Isolate* isolate) { |
.SetMethod("keyDown", &EventSenderBindings::KeyDown) |
.SetMethod("mouseDown", &EventSenderBindings::MouseDown) |
.SetMethod("mouseMoveTo", &EventSenderBindings::MouseMoveTo) |
+ .SetMethod("mouseLeave", &EventSenderBindings::MouseLeave) |
.SetMethod("trackpadScrollBegin", |
&EventSenderBindings::TrackpadScrollBegin) |
.SetMethod("trackpadScroll", &EventSenderBindings::TrackpadScroll) |
@@ -861,6 +863,11 @@ void EventSenderBindings::MouseMoveTo(gin::Arguments* args) { |
sender_->MouseMoveTo(args); |
} |
+void EventSenderBindings::MouseLeave() { |
+ if (sender_) |
+ sender_->MouseLeave(); |
+} |
+ |
void EventSenderBindings::TrackpadScrollBegin() { |
if (sender_) |
sender_->TrackpadScrollBegin(); |
@@ -1913,6 +1920,22 @@ void EventSender::MouseMoveTo(gin::Arguments* args) { |
} |
} |
+void EventSender::MouseLeave() { |
+ if (force_layout_on_events_) |
+ view_->layout(); |
+ |
+ WebMouseEvent event; |
+ InitMouseEvent(WebInputEvent::MouseLeave, |
+ WebMouseEvent::ButtonNone, |
+ last_mouse_pos_, |
+ GetCurrentEventTimeSec(), |
+ click_count_, |
+ 0, |
+ &event); |
+ view_->handleInputEvent(event); |
+} |
+ |
+ |
void EventSender::TrackpadScrollBegin() { |
WebMouseWheelEvent event; |
InitMouseEvent(WebInputEvent::MouseWheel, |