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

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

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 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 ea739ae9229269e7f39920d64948cd54c4d75f96..6d7c6bc6417d8b63dd9128d05c7f986a02f21cc6 100644
--- a/ui/views/widget/root_view_unittest.cc
+++ b/ui/views/widget/root_view_unittest.cc
@@ -391,17 +391,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::PointerEventDetails(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::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseExited(exit_event);
EXPECT_TRUE(view_destroyed);
@@ -431,18 +433,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::PointerEventDetails(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::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(moved_event2);
EXPECT_TRUE(view_destroyed);
@@ -495,17 +499,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::PointerEventDetails(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::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
root_view->OnMouseMoved(move_event2);
EXPECT_FALSE(widget_deletion_observer.IsWidgetAlive());
}
@@ -540,16 +547,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::PointerEventDetails(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::PointerEventDetails(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