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

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

Issue 502993004: Remove abstract Clone and Cancel methods from MotionEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nasty bug fix Created 6 years, 1 month 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
« no previous file with comments | « ui/events/test/mock_motion_event.cc ('k') | ui/events/test/motion_event_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
6 #define UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_
7
8 #include <string>
5 #include <vector> 9 #include <vector>
6 10
7 #include "base/basictypes.h" 11 #include "base/basictypes.h"
8 #include "base/time/time.h" 12 #include "base/time/time.h"
9 #include "ui/events/gesture_detection/motion_event_generic.h" 13 #include "ui/events/gesture_detection/motion_event_generic.h"
10 #include "ui/gfx/geometry/point_f.h" 14 #include "ui/gfx/geometry/point_f.h"
11 15
12 namespace ui { 16 namespace ui {
13 namespace test { 17 namespace test {
14 18
(...skipping 17 matching lines...) Expand all
32 float y1, 36 float y1,
33 float x2, 37 float x2,
34 float y2); 38 float y2);
35 MockMotionEvent(Action action, 39 MockMotionEvent(Action action,
36 base::TimeTicks time, 40 base::TimeTicks time,
37 const std::vector<gfx::PointF>& positions); 41 const std::vector<gfx::PointF>& positions);
38 MockMotionEvent(const MockMotionEvent& other); 42 MockMotionEvent(const MockMotionEvent& other);
39 43
40 ~MockMotionEvent() override; 44 ~MockMotionEvent() override;
41 45
42 // MotionEvent methods.
43 scoped_ptr<MotionEvent> Clone() const override;
44 scoped_ptr<MotionEvent> Cancel() const override;
45
46 // Utility methods. 46 // Utility methods.
47 void PressPoint(float x, float y); 47 void PressPoint(float x, float y);
48 void MovePoint(size_t index, float x, float y); 48 void MovePoint(size_t index, float x, float y);
49 void ReleasePoint(); 49 void ReleasePoint();
50 void CancelPoint(); 50 void CancelPoint();
51 void SetTouchMajor(float new_touch_major); 51 void SetTouchMajor(float new_touch_major);
52 void SetRawOffset(float raw_offset_x, float raw_offset_y); 52 void SetRawOffset(float raw_offset_x, float raw_offset_y);
53 void SetToolType(size_t index, ToolType tool_type); 53 void SetToolType(size_t index, ToolType tool_type);
54 54
55 private: 55 private:
56 void PushPointer(float x, float y); 56 void PushPointer(float x, float y);
57 void ResolvePointers(); 57 void ResolvePointers();
58 }; 58 };
59 59
60 std::string ToString(const MotionEvent& event);
61
60 } // namespace test 62 } // namespace test
61 } // namespace ui 63 } // namespace ui
64
65 #endif // UI_EVENTS_TEST_MOTION_EVENT_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « ui/events/test/mock_motion_event.cc ('k') | ui/events/test/motion_event_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698