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

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

Issue 928973002: Add mouseLeave API in eventSender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « content/shell/renderer/test_runner/event_sender.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « content/shell/renderer/test_runner/event_sender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698