| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ | 5 #ifndef UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ |
| 6 #define UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ | 6 #define UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 base::TimeTicks time, | 41 base::TimeTicks time, |
| 42 const std::vector<gfx::PointF>& positions); | 42 const std::vector<gfx::PointF>& positions); |
| 43 MockMotionEvent(const MockMotionEvent& other); | 43 MockMotionEvent(const MockMotionEvent& other); |
| 44 | 44 |
| 45 ~MockMotionEvent() override; | 45 ~MockMotionEvent() override; |
| 46 | 46 |
| 47 // Utility methods. | 47 // Utility methods. |
| 48 MockMotionEvent& PressPoint(float x, float y); | 48 MockMotionEvent& PressPoint(float x, float y); |
| 49 MockMotionEvent& MovePoint(size_t index, float x, float y); | 49 MockMotionEvent& MovePoint(size_t index, float x, float y); |
| 50 MockMotionEvent& ReleasePoint(); | 50 MockMotionEvent& ReleasePoint(); |
| 51 MockMotionEvent& ReleasePointAtIndex(size_t index); |
| 51 MockMotionEvent& CancelPoint(); | 52 MockMotionEvent& CancelPoint(); |
| 52 MockMotionEvent& SetTouchMajor(float new_touch_major); | 53 MockMotionEvent& SetTouchMajor(float new_touch_major); |
| 53 MockMotionEvent& SetRawOffset(float raw_offset_x, float raw_offset_y); | 54 MockMotionEvent& SetRawOffset(float raw_offset_x, float raw_offset_y); |
| 54 MockMotionEvent& SetToolType(size_t index, ToolType tool_type); | 55 MockMotionEvent& SetToolType(size_t index, ToolType tool_type); |
| 55 MockMotionEvent& SetPrimaryPointerId(int id); | 56 MockMotionEvent& SetPrimaryPointerId(int id); |
| 56 | 57 |
| 57 private: | 58 private: |
| 58 void PushPointer(float x, float y); | 59 void PushPointer(float x, float y); |
| 59 void UpdatePointersAndID(); | 60 void UpdatePointersAndID(); |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 std::string ToString(const MotionEvent& event); | 63 std::string ToString(const MotionEvent& event); |
| 63 | 64 |
| 64 } // namespace test | 65 } // namespace test |
| 65 } // namespace ui | 66 } // namespace ui |
| 66 | 67 |
| 67 #endif // UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ | 68 #endif // UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ |
| OLD | NEW |