| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 base::FilePath(kTestDevicePath), | 33 base::FilePath(kTestDevicePath), |
| 34 1, | 34 1, |
| 35 INPUT_DEVICE_UNKNOWN, | 35 INPUT_DEVICE_UNKNOWN, |
| 36 EventDeviceInfo(), | 36 EventDeviceInfo(), |
| 37 cursor, | 37 cursor, |
| 38 dispatcher) { | 38 dispatcher) { |
| 39 Start(); | 39 Start(); |
| 40 } | 40 } |
| 41 ~MockEventConverterEvdevImpl() override {} | 41 ~MockEventConverterEvdevImpl() override {} |
| 42 | 42 |
| 43 // EventConverterEvdevImpl: |
| 44 bool HasKeyboard() const override { return true; } |
| 45 bool HasTouchpad() const override { return true; } |
| 46 |
| 43 private: | 47 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(MockEventConverterEvdevImpl); | 48 DISALLOW_COPY_AND_ASSIGN(MockEventConverterEvdevImpl); |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 class MockCursorEvdev : public CursorDelegateEvdev { | 51 class MockCursorEvdev : public CursorDelegateEvdev { |
| 48 public: | 52 public: |
| 49 MockCursorEvdev() {} | 53 MockCursorEvdev() {} |
| 50 ~MockCursorEvdev() override {} | 54 ~MockCursorEvdev() override {} |
| 51 | 55 |
| 52 // CursorDelegateEvdev: | 56 // CursorDelegateEvdev: |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 dev->SetAllowedKeys(allowed_keys.Pass()); | 568 dev->SetAllowedKeys(allowed_keys.Pass()); |
| 565 ASSERT_EQ(1u, size()); | 569 ASSERT_EQ(1u, size()); |
| 566 event = dispatched_event(0); | 570 event = dispatched_event(0); |
| 567 EXPECT_EQ(ui::ET_KEY_RELEASED, event->type()); | 571 EXPECT_EQ(ui::ET_KEY_RELEASED, event->type()); |
| 568 | 572 |
| 569 // The real key release should be dropped, whenever it comes. | 573 // The real key release should be dropped, whenever it comes. |
| 570 ClearDispatchedEvents(); | 574 ClearDispatchedEvents(); |
| 571 dev->ProcessEvents(key_release, arraysize(key_release)); | 575 dev->ProcessEvents(key_release, arraysize(key_release)); |
| 572 ASSERT_EQ(0u, size()); | 576 ASSERT_EQ(0u, size()); |
| 573 } | 577 } |
| OLD | NEW |