1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_
6 #define UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_
11 #include "base/basictypes.h"
12 #include "base/time/time.h"
13 #include "ui/events/gesture_detection/motion_event_generic.h"
14 #include "ui/gfx/geometry/point_f.h"
19 struct MockMotionEvent
: public MotionEventGeneric
{
20 enum { TOUCH_MAJOR
= 10 };
23 explicit MockMotionEvent(Action action
);
24 MockMotionEvent(Action action
, base::TimeTicks time
, float x
, float y
);
25 MockMotionEvent(Action action
,
31 MockMotionEvent(Action action
,
39 MockMotionEvent(Action action
,
41 const std::vector
<gfx::PointF
>& positions
);
42 MockMotionEvent(const MockMotionEvent
& other
);
44 ~MockMotionEvent() override
;
47 void PressPoint(float x
, float y
);
48 void MovePoint(size_t index
, float x
, float y
);
51 void SetTouchMajor(float new_touch_major
);
52 void SetRawOffset(float raw_offset_x
, float raw_offset_y
);
53 void SetToolType(size_t index
, ToolType tool_type
);
56 void PushPointer(float x
, float y
);
57 void ResolvePointers();
60 std::string
ToString(const MotionEvent
& event
);
65 #endif // UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_