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

Unified Diff: ash/wm/panels/panel_layout_manager_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: ash/wm/panels/panel_layout_manager_unittest.cc
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index e43ecaa61424981e11a2ae79e05e67e874150417..195f14cac65c2f710308a839d74bad0b8c5bee9d 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -804,51 +804,51 @@ TEST_F(PanelLayoutManagerTest, TouchHitTestPanel) {
// Hit test outside the right edge with a bottom-aligned shelf.
SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM);
- gfx::Rect bounds(w->bounds());
+ gfx::RectF bounds(w->bounds());
ui::TouchEvent touch(ui::ET_TOUCH_PRESSED,
- gfx::Point(bounds.right() + 3, bounds.y() + 2),
- 0, ui::EventTimeForNow());
+ bounds.top_right() + gfx::Vector2dF(3.f, 2.f), 0,
+ ui::EventTimeForNow());
ui::EventTarget* target = targeter->FindTargetForEvent(root, &touch);
EXPECT_EQ(w.get(), target);
// Hit test outside the bottom edge with a bottom-aligned shelf.
- touch.set_location(gfx::Point(bounds.x() + 6, bounds.bottom() + 5));
+ touch.set_location(bounds.bottom_left() + gfx::Vector2dF(6.f, 5.f));
target = targeter->FindTargetForEvent(root, &touch);
EXPECT_NE(w.get(), target);
// Hit test outside the bottom edge with a right-aligned shelf.
SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_RIGHT);
- bounds = w->bounds();
- touch.set_location(gfx::Point(bounds.x() + 6, bounds.bottom() + 5));
+ bounds = gfx::RectF(w->bounds());
+ touch.set_location(bounds.bottom_left() + gfx::Vector2dF(6.f, 5.f));
target = targeter->FindTargetForEvent(root, &touch);
EXPECT_EQ(w.get(), target);
// Hit test outside the right edge with a right-aligned shelf.
- touch.set_location(gfx::Point(bounds.right() + 3, bounds.y() + 2));
+ touch.set_location(bounds.top_right() + gfx::Vector2dF(3.f, 2.f));
target = targeter->FindTargetForEvent(root, &touch);
EXPECT_NE(w.get(), target);
// Hit test outside the top edge with a left-aligned shelf.
SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_LEFT);
- bounds = w->bounds();
- touch.set_location(gfx::Point(bounds.x() + 4, bounds.y() - 6));
+ bounds = gfx::RectF(w->bounds());
+ touch.set_location(bounds.origin() + gfx::Vector2dF(4.f, -6.f));
target = targeter->FindTargetForEvent(root, &touch);
EXPECT_EQ(w.get(), target);
// Hit test outside the left edge with a left-aligned shelf.
- touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5));
+ touch.set_location(bounds.origin() + gfx::Vector2dF(-1.f, 5.f));
target = targeter->FindTargetForEvent(root, &touch);
EXPECT_NE(w.get(), target);
// Hit test outside the left edge with a top-aligned shelf.
SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_TOP);
- bounds = w->bounds();
- touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5));
+ bounds = gfx::RectF(w->bounds());
+ touch.set_location(bounds.origin() + gfx::Vector2dF(-1.f, 5.f));
target = targeter->FindTargetForEvent(root, &touch);
EXPECT_EQ(w.get(), target);
// Hit test outside the top edge with a top-aligned shelf.
- touch.set_location(gfx::Point(bounds.x() + 4, bounds.y() - 6));
+ touch.set_location(bounds.origin() + gfx::Vector2dF(4.f, -6.f));
target = targeter->FindTargetForEvent(root, &touch);
EXPECT_NE(w.get(), target);
}

Powered by Google App Engine
This is Rietveld 408576698