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 #include "ui/events/ozone/evdev/input_injector_evdev.h" | 5 #include "ui/events/ozone/evdev/input_injector_evdev.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 void MoveCursor(const gfx::Vector2dF& delta) override { | 60 void MoveCursor(const gfx::Vector2dF& delta) override { |
61 cursor_location_ = gfx::PointF(delta.x(), delta.y()); | 61 cursor_location_ = gfx::PointF(delta.x(), delta.y()); |
62 } | 62 } |
63 bool IsCursorVisible() override { return 1; } | 63 bool IsCursorVisible() override { return 1; } |
64 gfx::Rect GetCursorConfinedBounds() override { | 64 gfx::Rect GetCursorConfinedBounds() override { |
65 NOTIMPLEMENTED(); | 65 NOTIMPLEMENTED(); |
66 return gfx::Rect(); | 66 return gfx::Rect(); |
67 } | 67 } |
68 gfx::PointF GetLocation() override { return cursor_location_; } | 68 gfx::PointF GetLocation() override { return cursor_location_; } |
69 | 69 void InitializeOnEvdev() override {} |
70 private: | 70 private: |
71 // The location of the mock cursor. | 71 // The location of the mock cursor. |
72 gfx::PointF cursor_location_; | 72 gfx::PointF cursor_location_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(MockCursorEvdev); | 74 DISALLOW_COPY_AND_ASSIGN(MockCursorEvdev); |
75 }; | 75 }; |
76 | 76 |
77 MATCHER_P4(MatchesMouseEvent, type, button, x, y, "") { | 77 MATCHER_P4(MatchesMouseEvent, type, button, x, y, "") { |
78 if (arg->type() != type) { | 78 if (arg->type() != type) { |
79 *result_listener << "Expected type: " << type << " actual: " << arg->type() | 79 *result_listener << "Expected type: " << type << " actual: " << arg->type() |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 MatchesMouseEvent(ET_MOUSEWHEEL, 0, 10, 20), | 216 MatchesMouseEvent(ET_MOUSEWHEEL, 0, 10, 20), |
217 Property(&MouseWheelEvent::x_offset, 100), | 217 Property(&MouseWheelEvent::x_offset, 100), |
218 Property(&MouseWheelEvent::y_offset, 0)))); | 218 Property(&MouseWheelEvent::y_offset, 0)))); |
219 injector_.MoveCursorTo(gfx::PointF(10, 20)); | 219 injector_.MoveCursorTo(gfx::PointF(10, 20)); |
220 injector_.InjectMouseWheel(0, 100); | 220 injector_.InjectMouseWheel(0, 100); |
221 injector_.InjectMouseWheel(100, 0); | 221 injector_.InjectMouseWheel(100, 0); |
222 run_loop_.RunUntilIdle(); | 222 run_loop_.RunUntilIdle(); |
223 } | 223 } |
224 | 224 |
225 } // namespace ui | 225 } // namespace ui |
OLD | NEW |