| Index: ui/aura/window_targeter_unittest.cc
|
| diff --git a/ui/aura/window_targeter_unittest.cc b/ui/aura/window_targeter_unittest.cc
|
| index 36d36ae66daec1c25338432b2b4ce2c281a6742e..8dd6604966c3c39f0cf17df1c8d53aeb409fea33 100644
|
| --- a/ui/aura/window_targeter_unittest.cc
|
| +++ b/ui/aura/window_targeter_unittest.cc
|
| @@ -67,9 +67,9 @@ TEST_F(WindowTargeterTest, Basic) {
|
| ui::test::TestEventHandler handler;
|
| one->AddPreTargetHandler(&handler);
|
|
|
| - ui::MouseEvent press(ui::ET_MOUSE_PRESSED, gfx::Point(20, 20),
|
| - gfx::Point(20, 20), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent press(ui::ET_MOUSE_PRESSED, gfx::PointF(20.f, 20.f),
|
| + gfx::PointF(20.f, 20.f), ui::EventTimeForNow(),
|
| + ui::EF_NONE, ui::EF_NONE);
|
| DispatchEventUsingWindowDispatcher(&press);
|
| EXPECT_EQ(1, handler.num_mouse_events());
|
|
|
| @@ -92,7 +92,7 @@ TEST_F(WindowTargeterTest, ScopedWindowTargeter) {
|
| ui::EventTarget* root = root_window();
|
| ui::EventTargeter* targeter = root->GetEventTargeter();
|
|
|
| - gfx::Point event_location(60, 60);
|
| + gfx::PointF event_location(60.f, 60.f);
|
| {
|
| ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, event_location, event_location,
|
| ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
| @@ -142,7 +142,7 @@ TEST_F(WindowTargeterTest, TargetTransformedWindow) {
|
|
|
| ui::EventTarget* root_target = root_window();
|
| ui::EventTargeter* targeter = root_target->GetEventTargeter();
|
| - gfx::Point event_location(490, 50);
|
| + gfx::PointF event_location(490.f, 50.f);
|
| {
|
| ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, event_location, event_location,
|
| ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
| @@ -216,16 +216,18 @@ TEST_F(WindowTargeterTest, Bounds) {
|
| // Dispatch a mouse event that falls on the parent, but not on the child. When
|
| // the default event-targeter used, the event will still reach |grandchild|,
|
| // because the default targeter does not look at the bounds.
|
| - ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(1, 1), gfx::Point(1, 1),
|
| - ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
| + ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::PointF(1.f, 1.f),
|
| + gfx::PointF(1.f, 1.f), ui::EventTimeForNow(),
|
| + ui::EF_NONE, ui::EF_NONE);
|
| EXPECT_EQ(parent_r, targeter->FindTargetForEvent(root_target, &mouse));
|
|
|
| // Install a targeter on the |child| that looks at the window id as well
|
| // as the bounds and makes sure the event reaches the target only if the id of
|
| // the window is equal to 2 (incorrect). This causes the event to get handled
|
| // by |parent|.
|
| - ui::MouseEvent mouse2(ui::ET_MOUSE_MOVED, gfx::Point(8, 8), gfx::Point(8, 8),
|
| - ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
| + ui::MouseEvent mouse2(ui::ET_MOUSE_MOVED, gfx::PointF(8.f, 8.f),
|
| + gfx::PointF(8.f, 8.f), ui::EventTimeForNow(),
|
| + ui::EF_NONE, ui::EF_NONE);
|
| scoped_ptr<ui::EventTargeter> original_targeter = child_r->SetEventTargeter(
|
| scoped_ptr<ui::EventTargeter>(new IdCheckingEventTargeter(2)));
|
| EXPECT_EQ(parent_r, targeter->FindTargetForEvent(root_target, &mouse2));
|
| @@ -233,8 +235,9 @@ TEST_F(WindowTargeterTest, Bounds) {
|
| // Now install a targeter on the |child| that looks at the window id as well
|
| // as the bounds and makes sure the event reaches the target only if the id of
|
| // the window is equal to 1 (correct).
|
| - ui::MouseEvent mouse3(ui::ET_MOUSE_MOVED, gfx::Point(8, 8), gfx::Point(8, 8),
|
| - ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
| + ui::MouseEvent mouse3(ui::ET_MOUSE_MOVED, gfx::PointF(8.f, 8.f),
|
| + gfx::PointF(8.f, 8.f), ui::EventTimeForNow(),
|
| + ui::EF_NONE, ui::EF_NONE);
|
| child_r->SetEventTargeter(
|
| scoped_ptr<ui::EventTargeter>(new IdCheckingEventTargeter(1)));
|
| EXPECT_EQ(child_r, targeter->FindTargetForEvent(root_target, &mouse3));
|
| @@ -243,14 +246,15 @@ TEST_F(WindowTargeterTest, Bounds) {
|
| child_r->SetEventTargeter(original_targeter.Pass());
|
|
|
| // Target |grandchild| location.
|
| - ui::MouseEvent second(ui::ET_MOUSE_MOVED, gfx::Point(12, 12),
|
| - gfx::Point(12, 12), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent second(ui::ET_MOUSE_MOVED, gfx::PointF(12.f, 12.f),
|
| + gfx::PointF(12.f, 12.f), ui::EventTimeForNow(),
|
| + ui::EF_NONE, ui::EF_NONE);
|
| EXPECT_EQ(grandchild_r, targeter->FindTargetForEvent(root_target, &second));
|
|
|
| // Target |child| location.
|
| - ui::MouseEvent third(ui::ET_MOUSE_MOVED, gfx::Point(8, 8), gfx::Point(8, 8),
|
| - ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
| + ui::MouseEvent third(ui::ET_MOUSE_MOVED, gfx::PointF(8.f, 8.f),
|
| + gfx::PointF(8.f, 8.f), ui::EventTimeForNow(),
|
| + ui::EF_NONE, ui::EF_NONE);
|
| EXPECT_EQ(child_r, targeter->FindTargetForEvent(root_target, &third));
|
| }
|
|
|
| @@ -276,9 +280,9 @@ TEST_F(WindowTargeterTest, TargeterChecksOwningEventTarget) {
|
| ui::EventTarget* root_target = root_window();
|
| ui::EventTargeter* targeter = root_target->GetEventTargeter();
|
|
|
| - ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
|
| - gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::PointF(10.f, 10.f),
|
| + gfx::PointF(10.f, 10.f), ui::EventTimeForNow(),
|
| + ui::EF_NONE, ui::EF_NONE);
|
| EXPECT_EQ(child.get(), targeter->FindTargetForEvent(root_target, &mouse));
|
|
|
| // Install an event targeter on |child| which always prevents the target from
|
| @@ -286,9 +290,9 @@ TEST_F(WindowTargeterTest, TargeterChecksOwningEventTarget) {
|
| child->SetEventTargeter(
|
| scoped_ptr<ui::EventTargeter>(new IgnoreWindowTargeter()));
|
|
|
| - ui::MouseEvent mouse2(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
|
| - gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE,
|
| - ui::EF_NONE);
|
| + ui::MouseEvent mouse2(ui::ET_MOUSE_MOVED, gfx::PointF(10.f, 10.f),
|
| + gfx::PointF(10.f, 10.f), ui::EventTimeForNow(),
|
| + ui::EF_NONE, ui::EF_NONE);
|
| EXPECT_EQ(root_window(), targeter->FindTargetForEvent(root_target, &mouse2));
|
| }
|
|
|
|
|