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/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 const gfx::PointF& location) override { | 53 const gfx::PointF& location) override { |
54 cursor_location_ = location; | 54 cursor_location_ = location; |
55 } | 55 } |
56 void MoveCursorTo(const gfx::PointF& location) override { | 56 void MoveCursorTo(const gfx::PointF& location) override { |
57 cursor_location_ = location; | 57 cursor_location_ = location; |
58 } | 58 } |
59 void MoveCursor(const gfx::Vector2dF& delta) override { | 59 void MoveCursor(const gfx::Vector2dF& delta) override { |
60 cursor_location_ = gfx::PointF(delta.x(), delta.y()); | 60 cursor_location_ = gfx::PointF(delta.x(), delta.y()); |
61 } | 61 } |
62 bool IsCursorVisible() override { return 1; } | 62 bool IsCursorVisible() override { return 1; } |
63 gfx::Rect GetCursorDisplayBounds() override { | 63 gfx::Rect GetCursorConfinedBounds() override { |
64 NOTIMPLEMENTED(); | 64 NOTIMPLEMENTED(); |
65 return gfx::Rect(); | 65 return gfx::Rect(); |
66 } | 66 } |
67 gfx::PointF GetLocation() override { return cursor_location_; } | 67 gfx::PointF GetLocation() override { return cursor_location_; } |
68 | 68 |
69 private: | 69 private: |
70 // The location of the mock cursor. | 70 // The location of the mock cursor. |
71 gfx::PointF cursor_location_; | 71 gfx::PointF cursor_location_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(MockCursorEvdev); | 73 DISALLOW_COPY_AND_ASSIGN(MockCursorEvdev); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 MatchesMouseEvent(ET_MOUSEWHEEL, 0, 10, 20), | 210 MatchesMouseEvent(ET_MOUSEWHEEL, 0, 10, 20), |
211 Property(&MouseWheelEvent::x_offset, 100), | 211 Property(&MouseWheelEvent::x_offset, 100), |
212 Property(&MouseWheelEvent::y_offset, 0)))); | 212 Property(&MouseWheelEvent::y_offset, 0)))); |
213 injector_.MoveCursorTo(gfx::PointF(10, 20)); | 213 injector_.MoveCursorTo(gfx::PointF(10, 20)); |
214 injector_.InjectMouseWheel(0, 100); | 214 injector_.InjectMouseWheel(0, 100); |
215 injector_.InjectMouseWheel(100, 0); | 215 injector_.InjectMouseWheel(100, 0); |
216 run_loop_.RunUntilIdle(); | 216 run_loop_.RunUntilIdle(); |
217 } | 217 } |
218 | 218 |
219 } // namespace ui | 219 } // namespace ui |
OLD | NEW |