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

Side by Side Diff: ui/events/test/motion_event_test_utils.h

Issue 1087893003: Support longpress drag selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 5 years, 7 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 unified diff | Download patch
OLDNEW
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 26 matching lines...) Expand all
37 float x2, 37 float x2,
38 float y2); 38 float y2);
39 MockMotionEvent(Action action, 39 MockMotionEvent(Action action,
40 base::TimeTicks time, 40 base::TimeTicks time,
41 const std::vector<gfx::PointF>& positions); 41 const std::vector<gfx::PointF>& positions);
42 MockMotionEvent(const MockMotionEvent& other); 42 MockMotionEvent(const MockMotionEvent& other);
43 43
44 ~MockMotionEvent() override; 44 ~MockMotionEvent() override;
45 45
46 // Utility methods. 46 // Utility methods.
47 void PressPoint(float x, float y); 47 MockMotionEvent& PressPoint(float x, float y);
48 void MovePoint(size_t index, float x, float y); 48 MockMotionEvent& MovePoint(size_t index, float x, float y);
49 void ReleasePoint(); 49 MockMotionEvent& ReleasePoint();
50 void CancelPoint(); 50 MockMotionEvent& CancelPoint();
51 void SetTouchMajor(float new_touch_major); 51 MockMotionEvent& SetTouchMajor(float new_touch_major);
52 void SetRawOffset(float raw_offset_x, float raw_offset_y); 52 MockMotionEvent& SetRawOffset(float raw_offset_x, float raw_offset_y);
53 void SetToolType(size_t index, ToolType tool_type); 53 MockMotionEvent& SetToolType(size_t index, ToolType tool_type);
54 void SetPrimaryPointerId(int id); 54 MockMotionEvent& SetPrimaryPointerId(int id);
55 55
sadrul 2015/05/14 22:44:36 Interesting. I haven't seen this pattern used else
jdduke (slow) 2015/05/14 22:49:46 Isn't this pretty common with builder objects (con
sadrul 2015/05/14 22:55:32 Not sure. I don't think we have that many builders
56 private: 56 private:
57 void PushPointer(float x, float y); 57 void PushPointer(float x, float y);
58 void ResolvePointers(); 58 void ResolvePointers();
59 }; 59 };
60 60
61 std::string ToString(const MotionEvent& event); 61 std::string ToString(const MotionEvent& event);
62 62
63 } // namespace test 63 } // namespace test
64 } // namespace ui 64 } // namespace ui
65 65
66 #endif // UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_ 66 #endif // UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698