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

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

Issue 393953012: Eager Gesture Recognition on Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 4 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/browser/renderer_host/ui_events_helper.cc ('k') | ui/aura/gestures/gesture_recognizer_unittest.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 182f135650149c0afcac60a96a7a87d7da6c913f..079312c193298fc1eac96914d97999ea78376c53 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -294,21 +294,13 @@ void SimulateMouseEvent(WebContents* web_contents,
}
void SimulateTapAt(WebContents* web_contents, const gfx::Point& point) {
- const double kTapDurationSeconds =
- 0.5 * (ui::GestureConfiguration::
- min_touch_down_duration_in_seconds_for_click() +
- ui::GestureConfiguration::
- max_touch_down_duration_in_seconds_for_click());
- SyntheticWebTouchEvent touch;
- // Set the timestamp to the base::TimeDelta representing the current time.
- touch.SetTimestamp(base::TimeTicks::Now() - base::TimeTicks());
- touch.PressPoint(point.x(), point.y());
+ blink::WebGestureEvent tap;
+ tap.type = blink::WebGestureEvent::GestureTap;
+ tap.x = point.x();
+ tap.y = point.y();
RenderWidgetHostImpl* widget_host =
RenderWidgetHostImpl::From(web_contents->GetRenderViewHost());
- widget_host->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
- touch.timeStampSeconds += kTapDurationSeconds;
- touch.ReleasePoint(0);
- widget_host->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
+ widget_host->ForwardGestureEvent(tap);
}
void SimulateKeyPress(WebContents* web_contents,
« no previous file with comments | « content/browser/renderer_host/ui_events_helper.cc ('k') | ui/aura/gestures/gesture_recognizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698