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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 EXPECT_TRUE(pointer_event.IsPointerEvent()); | 849 EXPECT_TRUE(pointer_event.IsPointerEvent()); |
850 } | 850 } |
851 } | 851 } |
852 | 852 |
853 TEST(EventTest, PointerEventId) { | 853 TEST(EventTest, PointerEventId) { |
854 { | 854 { |
855 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), | 855 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), |
856 gfx::Point(0, 0), base::TimeTicks(), 0, 0); | 856 gfx::Point(0, 0), base::TimeTicks(), 0, 0); |
857 ui::PointerEvent pointer_event(mouse_event); | 857 ui::PointerEvent pointer_event(mouse_event); |
858 EXPECT_EQ(pointer_event.pointer_details().id, | 858 EXPECT_EQ(pointer_event.pointer_details().id, |
859 ui::MouseEvent::kMousePointerId); | 859 ui::MouseEvent::kDefaultMousePointerId); |
860 } | 860 } |
861 | 861 |
862 for (int touch_id = 0; touch_id < 8; touch_id++) { | 862 for (int touch_id = 0; touch_id < 8; touch_id++) { |
863 ui::TouchEvent touch_event( | 863 ui::TouchEvent touch_event( |
864 ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), base::TimeTicks(), | 864 ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), base::TimeTicks(), |
865 PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, touch_id)); | 865 PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, touch_id)); |
866 ui::PointerEvent pointer_event(touch_event); | 866 ui::PointerEvent pointer_event(touch_event); |
867 EXPECT_EQ(pointer_event.pointer_details().id, touch_id); | 867 EXPECT_EQ(pointer_event.pointer_details().id, touch_id); |
868 } | 868 } |
869 } | 869 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 XButtonEvent* button_event = &(native_event.xbutton); | 1092 XButtonEvent* button_event = &(native_event.xbutton); |
1093 button_event->type = ButtonPress; | 1093 button_event->type = ButtonPress; |
1094 button_event->button = 4; // A valid wheel button number between min and max. | 1094 button_event->button = 4; // A valid wheel button number between min and max. |
1095 MouseWheelEvent mouse_ev(&native_event); | 1095 MouseWheelEvent mouse_ev(&native_event); |
1096 | 1096 |
1097 histogram_tester.ExpectTotalCount("Event.Latency.OS.MOUSE_WHEEL", 1); | 1097 histogram_tester.ExpectTotalCount("Event.Latency.OS.MOUSE_WHEEL", 1); |
1098 #endif | 1098 #endif |
1099 } | 1099 } |
1100 | 1100 |
1101 } // namespace ui | 1101 } // namespace ui |
OLD | NEW |