| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include <wayland-server.h> | 6 #include <wayland-server.h> |
| 7 | 7 |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 wl_keyboard_send_key(keyboard->resource(), 2, 0, 30 /* a */, | 54 wl_keyboard_send_key(keyboard->resource(), 2, 0, 30 /* a */, |
| 55 WL_KEYBOARD_KEY_STATE_PRESSED); | 55 WL_KEYBOARD_KEY_STATE_PRESSED); |
| 56 | 56 |
| 57 std::unique_ptr<Event> event; | 57 std::unique_ptr<Event> event; |
| 58 EXPECT_CALL(delegate, DispatchEvent(_)).WillOnce(CloneEvent(&event)); | 58 EXPECT_CALL(delegate, DispatchEvent(_)).WillOnce(CloneEvent(&event)); |
| 59 | 59 |
| 60 Sync(); | 60 Sync(); |
| 61 ASSERT_TRUE(event); | 61 ASSERT_TRUE(event); |
| 62 ASSERT_TRUE(event->IsKeyEvent()); | 62 ASSERT_TRUE(event->IsKeyEvent()); |
| 63 | 63 |
| 64 auto key_event = event->AsKeyEvent(); | 64 auto* key_event = event->AsKeyEvent(); |
| 65 EXPECT_EQ(ui::VKEY_A, key_event->key_code()); | 65 EXPECT_EQ(ui::VKEY_A, key_event->key_code()); |
| 66 EXPECT_EQ(ET_KEY_PRESSED, key_event->type()); | 66 EXPECT_EQ(ET_KEY_PRESSED, key_event->type()); |
| 67 | 67 |
| 68 wl_keyboard_send_leave(keyboard->resource(), 3, surface->resource()); | 68 wl_keyboard_send_leave(keyboard->resource(), 3, surface->resource()); |
| 69 | 69 |
| 70 Sync(); | 70 Sync(); |
| 71 | 71 |
| 72 wl_keyboard_send_key(keyboard->resource(), 3, 0, 30 /* a */, | 72 wl_keyboard_send_key(keyboard->resource(), 3, 0, 30 /* a */, |
| 73 WL_KEYBOARD_KEY_STATE_PRESSED); | 73 WL_KEYBOARD_KEY_STATE_PRESSED); |
| 74 EXPECT_CALL(delegate, DispatchEvent(_)).Times(0); | 74 EXPECT_CALL(delegate, DispatchEvent(_)).Times(0); |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace ui | 77 } // namespace ui |
| OLD | NEW |