Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: ui/events/event_unittest.cc

Issue 2849083002: Add pointer id to the WebMouseEvent's constructors (Closed)
Patch Set: webmouseid Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« ui/events/event.h ('K') | « ui/events/event.cc ('k') | ui/events/events_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698