| 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 <linux/input.h> | 5 #include <linux/input.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 cursor_location_ = location; | 55 cursor_location_ = location; |
| 56 } | 56 } |
| 57 void MoveCursor(const gfx::Vector2dF& delta) override { | 57 void MoveCursor(const gfx::Vector2dF& delta) override { |
| 58 cursor_location_ = gfx::PointF(delta.x(), delta.y()); | 58 cursor_location_ = gfx::PointF(delta.x(), delta.y()); |
| 59 } | 59 } |
| 60 bool IsCursorVisible() override { return 1; } | 60 bool IsCursorVisible() override { return 1; } |
| 61 gfx::Rect GetCursorDisplayBounds() override { | 61 gfx::Rect GetCursorDisplayBounds() override { |
| 62 NOTIMPLEMENTED(); | 62 NOTIMPLEMENTED(); |
| 63 return gfx::Rect(); | 63 return gfx::Rect(); |
| 64 } | 64 } |
| 65 gfx::PointF location() override { return cursor_location_; } | 65 gfx::PointF GetLocation() override { return cursor_location_; } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 // The location of the mock cursor. | 68 // The location of the mock cursor. |
| 69 gfx::PointF cursor_location_; | 69 gfx::PointF cursor_location_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(MockCursorEvdev); | 71 DISALLOW_COPY_AND_ASSIGN(MockCursorEvdev); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace ui | 74 } // namespace ui |
| 75 | 75 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 {{0, 0}, EV_SYN, SYN_REPORT, 0}, | 442 {{0, 0}, EV_SYN, SYN_REPORT, 0}, |
| 443 }; | 443 }; |
| 444 | 444 |
| 445 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue)); | 445 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue)); |
| 446 EXPECT_EQ(1u, size()); | 446 EXPECT_EQ(1u, size()); |
| 447 | 447 |
| 448 ui::MouseEvent* event; | 448 ui::MouseEvent* event; |
| 449 | 449 |
| 450 event = dispatched_mouse_event(0); | 450 event = dispatched_mouse_event(0); |
| 451 EXPECT_EQ(ui::ET_MOUSE_MOVED, event->type()); | 451 EXPECT_EQ(ui::ET_MOUSE_MOVED, event->type()); |
| 452 EXPECT_EQ(cursor()->location(), gfx::PointF(4, 2)); | 452 EXPECT_EQ(cursor()->GetLocation(), gfx::PointF(4, 2)); |
| 453 } | 453 } |
| 454 | 454 |
| 455 TEST_F(EventConverterEvdevImplTest, UnmappedKeyPress) { | 455 TEST_F(EventConverterEvdevImplTest, UnmappedKeyPress) { |
| 456 ui::MockEventConverterEvdevImpl* dev = device(); | 456 ui::MockEventConverterEvdevImpl* dev = device(); |
| 457 | 457 |
| 458 struct input_event mock_kernel_queue[] = { | 458 struct input_event mock_kernel_queue[] = { |
| 459 {{0, 0}, EV_KEY, BTN_TOUCH, 1}, | 459 {{0, 0}, EV_KEY, BTN_TOUCH, 1}, |
| 460 {{0, 0}, EV_SYN, SYN_REPORT, 0}, | 460 {{0, 0}, EV_SYN, SYN_REPORT, 0}, |
| 461 | 461 |
| 462 {{0, 0}, EV_KEY, BTN_TOUCH, 0}, | 462 {{0, 0}, EV_KEY, BTN_TOUCH, 0}, |
| 463 {{0, 0}, EV_SYN, SYN_REPORT, 0}, | 463 {{0, 0}, EV_SYN, SYN_REPORT, 0}, |
| 464 }; | 464 }; |
| 465 | 465 |
| 466 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue)); | 466 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue)); |
| 467 EXPECT_EQ(0u, size()); | 467 EXPECT_EQ(0u, size()); |
| 468 } | 468 } |
| OLD | NEW |