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

Side by Side Diff: ui/events/ozone/evdev/input_injector_evdev_unittest.cc

Issue 873563002: [Ozone] Constrain the cursor when overscan insets are set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 #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
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
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
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc ('k') | ui/events/ozone/evdev/tablet_event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698