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

Unified Diff: content/public/test/browser_test_utils.cc

Issue 1308273003: Resend unconsumed scroll update from guest back to embedder (WebView Scroll Bubble). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't require GestureScrollBegin for touch-pad GestureFlingStart. Created 5 years, 3 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/public/test/browser_test_utils.h ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index 214b2fd61d678cca452e21f5e3fcde487f0bc5a8..1f199d8c64e1c87d3475d3577e93b1d8eebbaa61 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -410,6 +410,49 @@ void SimulateMouseEvent(WebContents* web_contents,
web_contents->GetRenderViewHost()->ForwardMouseEvent(mouse_event);
}
+void SimulateMouseWheelEvent(WebContents* web_contents,
+ const gfx::Point& point,
+ const gfx::Vector2d& delta) {
+ blink::WebMouseWheelEvent wheel_event;
+ wheel_event.type = blink::WebInputEvent::MouseWheel;
+ wheel_event.x = point.x();
+ wheel_event.y = point.y();
+ wheel_event.deltaX = delta.x();
+ wheel_event.deltaY = delta.y();
+ RenderWidgetHostImpl* widget_host =
+ RenderWidgetHostImpl::From(web_contents->GetRenderViewHost());
+ widget_host->ForwardWheelEvent(wheel_event);
+}
+
+void SimulateGestureScrollSequence(WebContents* web_contents,
+ const gfx::Point& point,
+ const gfx::Vector2dF& delta) {
+ RenderWidgetHostImpl* widget_host =
+ RenderWidgetHostImpl::From(web_contents->GetRenderViewHost());
+
+ blink::WebGestureEvent scroll_begin;
+ scroll_begin.type = blink::WebGestureEvent::GestureScrollBegin;
+ scroll_begin.x = point.x();
+ scroll_begin.y = point.y();
+ widget_host->ForwardGestureEvent(scroll_begin);
+
+ blink::WebGestureEvent scroll_update;
+ scroll_update.type = blink::WebGestureEvent::GestureScrollUpdate;
+ scroll_update.x = point.x();
+ scroll_update.y = point.y();
+ scroll_update.data.scrollUpdate.deltaX = delta.x();
+ scroll_update.data.scrollUpdate.deltaY = delta.y();
+ scroll_update.data.scrollUpdate.velocityX = 0;
+ scroll_update.data.scrollUpdate.velocityY = 0;
+ widget_host->ForwardGestureEvent(scroll_update);
+
+ blink::WebGestureEvent scroll_end;
+ scroll_end.type = blink::WebGestureEvent::GestureScrollEnd;
+ scroll_end.x = point.x() + delta.x();
+ scroll_end.y = point.y() + delta.y();
+ widget_host->ForwardGestureEvent(scroll_end);
+}
+
void SimulateTapAt(WebContents* web_contents, const gfx::Point& point) {
blink::WebGestureEvent tap;
tap.type = blink::WebGestureEvent::GestureTap;
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698