| 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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 const struct { | 891 const struct { |
| 892 ui::EventType in_type; | 892 ui::EventType in_type; |
| 893 ui::EventType out_type; | 893 ui::EventType out_type; |
| 894 gfx::Point location; | 894 gfx::Point location; |
| 895 gfx::Point root_location; | 895 gfx::Point root_location; |
| 896 int flags; | 896 int flags; |
| 897 } kTestData[] = { | 897 } kTestData[] = { |
| 898 {ui::ET_POINTER_DOWN, ui::ET_MOUSE_PRESSED, gfx::Point(10, 20), | 898 {ui::ET_POINTER_DOWN, ui::ET_MOUSE_PRESSED, gfx::Point(10, 20), |
| 899 gfx::Point(110, 120), 0}, | 899 gfx::Point(110, 120), 0}, |
| 900 {ui::ET_POINTER_MOVED, ui::ET_MOUSE_MOVED, gfx::Point(20, 10), | 900 {ui::ET_POINTER_MOVED, ui::ET_MOUSE_MOVED, gfx::Point(20, 10), |
| 901 gfx::Point(1, 2), 0}, |
| 902 {ui::ET_POINTER_MOVED, ui::ET_MOUSE_DRAGGED, gfx::Point(20, 10), |
| 901 gfx::Point(1, 2), EF_LEFT_MOUSE_BUTTON}, | 903 gfx::Point(1, 2), EF_LEFT_MOUSE_BUTTON}, |
| 904 {ui::ET_POINTER_MOVED, ui::ET_MOUSE_DRAGGED, gfx::Point(20, 10), |
| 905 gfx::Point(1, 2), EF_RIGHT_MOUSE_BUTTON}, |
| 906 {ui::ET_POINTER_MOVED, ui::ET_MOUSE_DRAGGED, gfx::Point(20, 10), |
| 907 gfx::Point(1, 2), EF_MIDDLE_MOUSE_BUTTON}, |
| 902 {ui::ET_POINTER_ENTERED, ui::ET_MOUSE_ENTERED, gfx::Point(), gfx::Point(), | 908 {ui::ET_POINTER_ENTERED, ui::ET_MOUSE_ENTERED, gfx::Point(), gfx::Point(), |
| 903 EF_MIDDLE_MOUSE_BUTTON | EF_RIGHT_MOUSE_BUTTON}, | 909 EF_MIDDLE_MOUSE_BUTTON | EF_RIGHT_MOUSE_BUTTON}, |
| 904 {ui::ET_POINTER_EXITED, ui::ET_MOUSE_EXITED, gfx::Point(5, 1), | 910 {ui::ET_POINTER_EXITED, ui::ET_MOUSE_EXITED, gfx::Point(5, 1), |
| 905 gfx::Point(1, 5), EF_RIGHT_MOUSE_BUTTON}, | 911 gfx::Point(1, 5), EF_RIGHT_MOUSE_BUTTON}, |
| 906 {ui::ET_POINTER_UP, ui::ET_MOUSE_RELEASED, gfx::Point(1000, 1000), | 912 {ui::ET_POINTER_UP, ui::ET_MOUSE_RELEASED, gfx::Point(1000, 1000), |
| 907 gfx::Point(14, 15), EF_MIDDLE_MOUSE_BUTTON}}; | 913 gfx::Point(14, 15), EF_MIDDLE_MOUSE_BUTTON}}; |
| 908 | 914 |
| 909 for (size_t i = 0; i < arraysize(kTestData); i++) { | 915 for (size_t i = 0; i < arraysize(kTestData); i++) { |
| 910 ui::PointerEvent pointer_event( | 916 ui::PointerEvent pointer_event( |
| 911 kTestData[i].in_type, ui::EventPointerType::POINTER_TYPE_MOUSE, | 917 kTestData[i].in_type, ui::EventPointerType::POINTER_TYPE_MOUSE, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 button_event->type = ButtonPress; | 1004 button_event->type = ButtonPress; |
| 999 button_event->button = 4; // A valid wheel button number between min and max. | 1005 button_event->button = 4; // A valid wheel button number between min and max. |
| 1000 MouseWheelEvent mouse_ev(&native_event); | 1006 MouseWheelEvent mouse_ev(&native_event); |
| 1001 | 1007 |
| 1002 histogram_tester.ExpectTotalCount("Event.Latency.OS.MOUSE_WHEEL", 1); | 1008 histogram_tester.ExpectTotalCount("Event.Latency.OS.MOUSE_WHEEL", 1); |
| 1003 #endif | 1009 #endif |
| 1004 } | 1010 } |
| 1005 | 1011 |
| 1006 | 1012 |
| 1007 } // namespace ui | 1013 } // namespace ui |
| OLD | NEW |