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

Unified Diff: tools/ipc_fuzzer/mutate/generate.cc

Issue 942133002: Adding synthetic touch/mouse drag [Part2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mousedrag
Patch Set: Fixing nit. 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
Index: tools/ipc_fuzzer/mutate/generate.cc
diff --git a/tools/ipc_fuzzer/mutate/generate.cc b/tools/ipc_fuzzer/mutate/generate.cc
index ba3dc997eac2b2e83d6179d4e98184de74d31d03..0baca8ecc420bac74693936efcef2ddeefc5d39b 100644
--- a/tools/ipc_fuzzer/mutate/generate.cc
+++ b/tools/ipc_fuzzer/mutate/generate.cc
@@ -992,7 +992,7 @@ struct GenerateTraits<content::SyntheticGesturePacket> {
static bool Generate(content::SyntheticGesturePacket* p,
Generator* generator) {
scoped_ptr<content::SyntheticGestureParams> gesture_params;
- switch (RandInRange(3)) {
+ switch (RandInRange(4)) {
dcheng 2015/02/26 17:56:51 This doesn't seem very future proof =)
ssid 2015/02/26 20:02:34 Changed.
case content::SyntheticGestureParams::GestureType::
SMOOTH_SCROLL_GESTURE: {
content::SyntheticSmoothScrollGestureParams* params =
@@ -1008,6 +1008,19 @@ struct GenerateTraits<content::SyntheticGesturePacket> {
gesture_params.reset(params);
break;
}
+ case content::SyntheticGestureParams::GestureType::
+ SMOOTH_MOUSE_DRAG_GESTURE: {
+ content::SyntheticSmoothMouseDragGestureParams* params =
+ new content::SyntheticSmoothMouseDragGestureParams();
+ if (!GenerateParam(&params->start_point, generator))
+ return false;
+ if (!GenerateParam(&params->distances, generator))
+ return false;
+ if (!GenerateParam(&params->speed_in_pixels_s, generator))
+ return false;
+ gesture_params.reset(params);
+ break;
+ }
case content::SyntheticGestureParams::GestureType::PINCH_GESTURE: {
content::SyntheticPinchGestureParams* params =
new content::SyntheticPinchGestureParams();

Powered by Google App Engine
This is Rietveld 408576698