Index: ui/events/test/motion_event_test_utils.h |
diff --git a/ui/events/test/mock_motion_event.h b/ui/events/test/motion_event_test_utils.h |
similarity index 66% |
rename from ui/events/test/mock_motion_event.h |
rename to ui/events/test/motion_event_test_utils.h |
index d04d7154eab7f90b0ee13541d4951cc83519e666..de8d6a21f83e0ed1b8cac91164d0d8f0c8d7fbca 100644 |
--- a/ui/events/test/mock_motion_event.h |
+++ b/ui/events/test/motion_event_test_utils.h |
@@ -2,6 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#ifndef UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ |
+#define UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ |
+ |
+#include <string> |
#include <vector> |
#include "base/basictypes.h" |
@@ -39,23 +43,24 @@ struct MockMotionEvent : public MotionEventGeneric { |
~MockMotionEvent() override; |
- // MotionEvent methods. |
- scoped_ptr<MotionEvent> Clone() const override; |
- scoped_ptr<MotionEvent> Cancel() const override; |
- |
// Utility methods. |
- void PressPoint(float x, float y); |
- void MovePoint(size_t index, float x, float y); |
- void ReleasePoint(); |
- void CancelPoint(); |
- void SetTouchMajor(float new_touch_major); |
- void SetRawOffset(float raw_offset_x, float raw_offset_y); |
- void SetToolType(size_t index, ToolType tool_type); |
+ MockMotionEvent& PressPoint(float x, float y); |
+ MockMotionEvent& MovePoint(size_t index, float x, float y); |
+ MockMotionEvent& ReleasePoint(); |
+ MockMotionEvent& CancelPoint(); |
+ MockMotionEvent& SetTouchMajor(float new_touch_major); |
+ MockMotionEvent& SetRawOffset(float raw_offset_x, float raw_offset_y); |
+ MockMotionEvent& SetToolType(size_t index, ToolType tool_type); |
+ MockMotionEvent& SetPrimaryPointerId(int id); |
private: |
void PushPointer(float x, float y); |
- void ResolvePointers(); |
+ void UpdatePointersAndID(); |
}; |
+std::string ToString(const MotionEvent& event); |
+ |
} // namespace test |
} // namespace ui |
+ |
+#endif // UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ |