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

Unified Diff: ui/events/event_dispatcher_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/events/event_dispatcher_unittest.cc
diff --git a/ui/events/event_dispatcher_unittest.cc b/ui/events/event_dispatcher_unittest.cc
index b57d92b4dfdf50c125b8991e39748dc468776cf9..54f07df1ad5e53d0f83fad7fbf9cba745fb0fade 100644
--- a/ui/events/event_dispatcher_unittest.cc
+++ b/ui/events/event_dispatcher_unittest.cc
@@ -236,8 +236,10 @@ TEST(EventDispatcherTest, EventDispatchOrder) {
h7.set_expect_post_target(true);
h8.set_expect_post_target(true);
- MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
- ui::EventTimeForNow(), 0, 0);
+ MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
Event::DispatcherApi event_mod(&mouse);
dispatcher.ProcessEvent(&child, &mouse);
EXPECT_FALSE(mouse.stopped_propagation());
@@ -310,8 +312,10 @@ TEST(EventDispatcherTest, EventDispatchPhase) {
handler.set_expect_pre_target(true);
handler.set_expect_post_target(true);
- MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
- ui::EventTimeForNow(), 0, 0);
+ MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
Event::DispatcherApi event_mod(&mouse);
dispatcher.ProcessEvent(&target, &mouse);
EXPECT_EQ(ER_UNHANDLED, mouse.result());
@@ -342,8 +346,10 @@ TEST(EventDispatcherTest, EventDispatcherDestroyedDuringDispatch) {
// destroyed the dispatcher.
h2.set_expect_pre_target(false);
- MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
- ui::EventTimeForNow(), 0, 0);
+ MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
EventDispatchDetails details = dispatcher->ProcessEvent(&target, &mouse);
EXPECT_TRUE(details.dispatcher_destroyed);
EXPECT_EQ(ER_CONSUMED, mouse.result());
@@ -394,8 +400,10 @@ TEST(EventDispatcherTest, EventDispatcherDestroyedDuringDispatch) {
// destroyed the dispatcher.
h2.set_expect_post_target(false);
- MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
- ui::EventTimeForNow(), 0, 0);
+ MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
EventDispatchDetails details = dispatcher->ProcessEvent(&target, &mouse);
EXPECT_TRUE(details.dispatcher_destroyed);
EXPECT_EQ(ER_CONSUMED, mouse.result());
@@ -448,8 +456,10 @@ TEST(EventDispatcherTest, EventDispatcherInvalidateTarget) {
// |h3| should not receive events as the target will be invalidated.
h3.set_expect_pre_target(false);
- MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
- ui::EventTimeForNow(), 0, 0);
+ MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
EventDispatchDetails details = dispatcher.ProcessEvent(&target, &mouse);
EXPECT_FALSE(details.dispatcher_destroyed);
EXPECT_TRUE(details.target_destroyed);
@@ -491,8 +501,10 @@ TEST(EventDispatcherTest, EventHandlerDestroyedDuringDispatch) {
// destroyed it.
h3->set_expect_pre_target(false);
- MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
- ui::EventTimeForNow(), 0, 0);
+ MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
EventDispatchDetails details = dispatcher.ProcessEvent(&target, &mouse);
EXPECT_FALSE(details.dispatcher_destroyed);
EXPECT_FALSE(details.target_destroyed);
@@ -549,8 +561,10 @@ TEST(EventDispatcherTest, EventHandlerAndDispatcherDestroyedDuringDispatch) {
// it.
h3->set_expect_pre_target(false);
- MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
- ui::EventTimeForNow(), 0, 0);
+ MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
EventDispatchDetails details = dispatcher->ProcessEvent(&target, &mouse);
EXPECT_TRUE(details.dispatcher_destroyed);
EXPECT_TRUE(mouse.stopped_propagation());

Powered by Google App Engine
This is Rietveld 408576698