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

Unified Diff: ui/views/widget/root_view_unittest.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/root_view_unittest.cc
diff --git a/ui/views/widget/root_view_unittest.cc b/ui/views/widget/root_view_unittest.cc
index 54eeee2164465677ba5b43a9869d72fb1d715e13..aaa9d7e9df0f80250e05f8441bfd2f1be24deb76 100644
--- a/ui/views/widget/root_view_unittest.cc
+++ b/ui/views/widget/root_view_unittest.cc
@@ -378,17 +378,19 @@ TEST_F(RootViewTest, DeleteViewOnMouseExitDispatch) {
// Generate a mouse move event which ensures that the mouse_moved_handler_
// member is set in the RootView class.
- ui::MouseEvent moved_event(ui::ET_MOUSE_MOVED, gfx::Point(15, 15),
- gfx::Point(15, 15), ui::EventTimeForNow(), 0,
- 0);
+ ui::MouseEvent moved_event(
+ ui::ET_MOUSE_MOVED, gfx::Point(15, 15), gfx::Point(15, 15),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(moved_event);
ASSERT_FALSE(view_destroyed);
// Generate a mouse exit event which in turn will delete the child view which
// was the target of the mouse move event above. This should not crash when
// the mouse exit handler returns from the child.
- ui::MouseEvent exit_event(ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(),
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent exit_event(
+ ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 0,
+ 0, ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseExited(exit_event);
EXPECT_TRUE(view_destroyed);
@@ -418,18 +420,20 @@ TEST_F(RootViewTest, DeleteViewOnMouseEnterDispatch) {
static_cast<internal::RootView*>(widget.GetRootView());
// Move the mouse within |widget| but outside of |child|.
- ui::MouseEvent moved_event(ui::ET_MOUSE_MOVED, gfx::Point(15, 15),
- gfx::Point(15, 15), ui::EventTimeForNow(), 0,
- 0);
+ ui::MouseEvent moved_event(
+ ui::ET_MOUSE_MOVED, gfx::Point(15, 15), gfx::Point(15, 15),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(moved_event);
ASSERT_FALSE(view_destroyed);
// Move the mouse within |child|, which should dispatch a mouse enter event to
// |child| and destroy the view. This should not crash when the mouse enter
// handler returns from the child.
- ui::MouseEvent moved_event2(ui::ET_MOUSE_MOVED, gfx::Point(115, 115),
- gfx::Point(115, 115), ui::EventTimeForNow(), 0,
- 0);
+ ui::MouseEvent moved_event2(
+ ui::ET_MOUSE_MOVED, gfx::Point(115, 115), gfx::Point(115, 115),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(moved_event2);
EXPECT_TRUE(view_destroyed);
@@ -482,17 +486,20 @@ TEST_F(RootViewTest, DeleteWidgetOnMouseExitDispatch) {
static_cast<internal::RootView*>(widget->GetRootView());
// Move the mouse within |child|.
- ui::MouseEvent moved_event(ui::ET_MOUSE_MOVED, gfx::Point(115, 115),
- gfx::Point(115, 115), ui::EventTimeForNow(), 0,
- 0);
+ ui::MouseEvent moved_event(
+ ui::ET_MOUSE_MOVED, gfx::Point(115, 115), gfx::Point(115, 115),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(moved_event);
ASSERT_TRUE(widget_deletion_observer.IsWidgetAlive());
// Move the mouse outside of |child| which should dispatch a mouse exit event
// to |child| and destroy the widget. This should not crash when the mouse
// exit handler returns from the child.
- ui::MouseEvent move_event2(ui::ET_MOUSE_MOVED, gfx::Point(15, 15),
- gfx::Point(15, 15), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move_event2(
+ ui::ET_MOUSE_MOVED, gfx::Point(15, 15), gfx::Point(15, 15),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(move_event2);
EXPECT_FALSE(widget_deletion_observer.IsWidgetAlive());
}
@@ -527,16 +534,20 @@ TEST_F(RootViewTest, DeleteWidgetOnMouseExitDispatchFromChild) {
static_cast<internal::RootView*>(widget->GetRootView());
// Move the mouse within |subchild| and |child|.
- ui::MouseEvent moved_event(ui::ET_MOUSE_MOVED, gfx::Point(115, 115),
- gfx::Point(115, 115), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent moved_event(
+ ui::ET_MOUSE_MOVED, gfx::Point(115, 115), gfx::Point(115, 115),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(moved_event);
ASSERT_TRUE(widget_deletion_observer.IsWidgetAlive());
// Move the mouse outside of |subchild| and |child| which should dispatch a
// mouse exit event to |subchild| and destroy the widget. This should not
// crash when the mouse exit handler returns from |subchild|.
- ui::MouseEvent move_event2(ui::ET_MOUSE_MOVED, gfx::Point(15, 15),
- gfx::Point(15, 15), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move_event2(
+ ui::ET_MOUSE_MOVED, gfx::Point(15, 15), gfx::Point(15, 15),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(move_event2);
EXPECT_FALSE(widget_deletion_observer.IsWidgetAlive());
}
« ui/events/event.h ('K') | « ui/views/widget/root_view.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698