| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/event.h" | 5 #include "ui/events/event.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 ui::PointerEvent* clone_as_ptr = clone->AsPointerEvent(); | 879 ui::PointerEvent* clone_as_ptr = clone->AsPointerEvent(); |
| 880 | 880 |
| 881 EXPECT_EQ(ptr_event.type(), clone_as_ptr->type()); | 881 EXPECT_EQ(ptr_event.type(), clone_as_ptr->type()); |
| 882 EXPECT_EQ(ptr_event.pointer_id(), clone_as_ptr->pointer_id()); | 882 EXPECT_EQ(ptr_event.pointer_id(), clone_as_ptr->pointer_id()); |
| 883 EXPECT_EQ(ptr_event.pointer_details(), clone_as_ptr->pointer_details()); | 883 EXPECT_EQ(ptr_event.pointer_details(), clone_as_ptr->pointer_details()); |
| 884 EXPECT_EQ(ptr_event.location(), clone_as_ptr->location()); | 884 EXPECT_EQ(ptr_event.location(), clone_as_ptr->location()); |
| 885 EXPECT_EQ(ptr_event.root_location(), clone_as_ptr->root_location()); | 885 EXPECT_EQ(ptr_event.root_location(), clone_as_ptr->root_location()); |
| 886 } | 886 } |
| 887 } | 887 } |
| 888 | 888 |
| 889 TEST(EventTest, MouseEventLatencyUIComponentExists) { |
| 890 const gfx::Point origin(0, 0); |
| 891 MouseEvent mouseev(ET_MOUSE_PRESSED, origin, origin, EventTimeForNow(), 0, 0); |
| 892 EXPECT_TRUE(mouseev.latency()->FindLatency( |
| 893 ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, nullptr)); |
| 894 } |
| 895 |
| 896 TEST(EventTest, MouseWheelEventLatencyUIComponentExists) { |
| 897 const gfx::Point origin(0, 0); |
| 898 MouseWheelEvent mouseWheelev(gfx::Vector2d(), origin, origin, |
| 899 EventTimeForNow(), 0, 0); |
| 900 EXPECT_TRUE(mouseWheelev.latency()->FindLatency( |
| 901 ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, nullptr)); |
| 902 } |
| 903 |
| 889 } // namespace ui | 904 } // namespace ui |
| OLD | NEW |