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

Unified Diff: ui/events/event_dispatcher_unittest.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 3 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..6f0e76d4fc38e59d3827d9f6970a1f5d16011770 100644
--- a/ui/events/event_dispatcher_unittest.cc
+++ b/ui/events/event_dispatcher_unittest.cc
@@ -236,8 +236,8 @@ 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::PointF(3.f, 4.f),
+ gfx::PointF(3.f, 4.f), ui::EventTimeForNow(), 0, 0);
Event::DispatcherApi event_mod(&mouse);
dispatcher.ProcessEvent(&child, &mouse);
EXPECT_FALSE(mouse.stopped_propagation());
@@ -310,8 +310,8 @@ 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::PointF(3.f, 4.f),
+ gfx::PointF(3.f, 4.f), ui::EventTimeForNow(), 0, 0);
Event::DispatcherApi event_mod(&mouse);
dispatcher.ProcessEvent(&target, &mouse);
EXPECT_EQ(ER_UNHANDLED, mouse.result());
@@ -342,8 +342,8 @@ 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::PointF(3.f, 4.f),
+ gfx::PointF(3.f, 4.f), ui::EventTimeForNow(), 0, 0);
EventDispatchDetails details = dispatcher->ProcessEvent(&target, &mouse);
EXPECT_TRUE(details.dispatcher_destroyed);
EXPECT_EQ(ER_CONSUMED, mouse.result());
@@ -394,8 +394,8 @@ 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::PointF(3.f, 4.f),
+ gfx::PointF(3.f, 4.f), ui::EventTimeForNow(), 0, 0);
EventDispatchDetails details = dispatcher->ProcessEvent(&target, &mouse);
EXPECT_TRUE(details.dispatcher_destroyed);
EXPECT_EQ(ER_CONSUMED, mouse.result());
@@ -448,8 +448,8 @@ 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::PointF(3.f, 4.f),
+ gfx::PointF(3.f, 4.f), ui::EventTimeForNow(), 0, 0);
EventDispatchDetails details = dispatcher.ProcessEvent(&target, &mouse);
EXPECT_FALSE(details.dispatcher_destroyed);
EXPECT_TRUE(details.target_destroyed);
@@ -491,8 +491,8 @@ 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::PointF(3.f, 4.f),
+ gfx::PointF(3.f, 4.f), ui::EventTimeForNow(), 0, 0);
EventDispatchDetails details = dispatcher.ProcessEvent(&target, &mouse);
EXPECT_FALSE(details.dispatcher_destroyed);
EXPECT_FALSE(details.target_destroyed);
@@ -549,8 +549,8 @@ 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::PointF(3.f, 4.f),
+ gfx::PointF(3.f, 4.f), ui::EventTimeForNow(), 0, 0);
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