| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 InputInjectorEvdevTest(); | 105 InputInjectorEvdevTest(); |
| 106 | 106 |
| 107 protected: | 107 protected: |
| 108 void SimulateMouseClick(int x, int y, EventFlags button, int count); | 108 void SimulateMouseClick(int x, int y, EventFlags button, int count); |
| 109 void ExpectClick(int x, int y, int button, int count); | 109 void ExpectClick(int x, int y, int button, int count); |
| 110 | 110 |
| 111 EventObserver event_observer_; | 111 EventObserver event_observer_; |
| 112 EventDispatchCallback dispatch_callback_; | 112 EventDispatchCallback dispatch_callback_; |
| 113 MockCursorEvdev cursor_; | 113 MockCursorEvdev cursor_; |
| 114 | 114 |
| 115 scoped_ptr<DeviceManager> device_manager_; | 115 std::unique_ptr<DeviceManager> device_manager_; |
| 116 scoped_ptr<EventFactoryEvdev> event_factory_; | 116 std::unique_ptr<EventFactoryEvdev> event_factory_; |
| 117 | 117 |
| 118 InputInjectorEvdev injector_; | 118 InputInjectorEvdev injector_; |
| 119 | 119 |
| 120 base::MessageLoop message_loop_; | 120 base::MessageLoop message_loop_; |
| 121 base::RunLoop run_loop_; | 121 base::RunLoop run_loop_; |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 DISALLOW_COPY_AND_ASSIGN(InputInjectorEvdevTest); | 124 DISALLOW_COPY_AND_ASSIGN(InputInjectorEvdevTest); |
| 125 }; | 125 }; |
| 126 | 126 |
| (...skipping 89 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 |