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

Unified Diff: components/test_runner/event_sender.cc

Issue 2158173002: Max start velocity should be greater than zero. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the gesture fling start with zero velocity fixed in the layout test. Created 4 years, 5 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 | « no previous file | third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scrollbar-fling.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/event_sender.cc
diff --git a/components/test_runner/event_sender.cc b/components/test_runner/event_sender.cc
index 3a4b797d6e1975e1ecdd3bec535f02f6a7e302cb..abb7dd8f3dd7848be70d309876d73e398b47e49c 100644
--- a/components/test_runner/event_sender.cc
+++ b/components/test_runner/event_sender.cc
@@ -1923,6 +1923,14 @@ void EventSender::GestureFlingStart(float x,
return;
}
+ float max_start_velocity = std::max(fabs(velocity_x), fabs(velocity_y));
+ if (!max_start_velocity) {
+ v8::Isolate* isolate = blink::mainThreadIsolate();
+ isolate->ThrowException(v8::Exception::TypeError(
+ gin::StringToV8(isolate, "Invalid max start velocity.")));
+ return;
+ }
+
event.x = x;
event.y = y;
event.globalX = event.x;
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scrollbar-fling.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698