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

Unified Diff: content/browser/renderer_host/input/touch_emulator.cc

Issue 249613002: [DevTools] Interactive test for DevTools touch emulation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK Created 6 years, 8 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
Index: content/browser/renderer_host/input/touch_emulator.cc
diff --git a/content/browser/renderer_host/input/touch_emulator.cc b/content/browser/renderer_host/input/touch_emulator.cc
index 785935f3d9a9a2ce41cc2dbc89b3a766db51cdbe..938944c78bb9d02dcba1314531657ab7f5988bbd 100644
--- a/content/browser/renderer_host/input/touch_emulator.cc
+++ b/content/browser/renderer_host/input/touch_emulator.cc
@@ -341,6 +341,11 @@ bool TouchEmulator::FillTouchEventAndPoint(const WebMouseEvent& mouse_event) {
touch_event_.touchesLength = 1;
touch_event_.timeStampSeconds = mouse_event.timeStampSeconds;
+ if (!touch_event_.timeStampSeconds) {
+ // Gesture detector does not tolerate null timestamps generated in tests.
+ touch_event_.timeStampSeconds =
+ (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
+ }
touch_event_.modifiers = mouse_event.modifiers;
WebTouchPoint& point = touch_event_.touches[0];

Powered by Google App Engine
This is Rietveld 408576698