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

Unified Diff: ash/shelf/shelf_tooltip_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/shelf/shelf_tooltip_manager_unittest.cc
diff --git a/ash/shelf/shelf_tooltip_manager_unittest.cc b/ash/shelf/shelf_tooltip_manager_unittest.cc
index 6ebb063ec48221ad0406f0cd7ea304eb0c3bfee0..528bc4774ae6845aca805c1cea2de0d52e1b3345 100644
--- a/ash/shelf/shelf_tooltip_manager_unittest.cc
+++ b/ash/shelf/shelf_tooltip_manager_unittest.cc
@@ -191,8 +191,8 @@ TEST_F(ShelfTooltipManagerTest, ShouldHideForEvents) {
EXPECT_TRUE(TooltipIsVisible());
// Should hide for touch events.
- ui::TouchEvent touch_event(
- ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta());
+ ui::TouchEvent touch_event(ui::ET_TOUCH_PRESSED, gfx::PointF(), 0,
+ base::TimeDelta());
SetEventTarget(root_window, &touch_event);
event_handler->OnTouchEvent(&touch_event);
EXPECT_FALSE(touch_event.handled());
@@ -227,7 +227,8 @@ TEST_F(ShelfTooltipManagerTest, HideForMouseMoveEvent) {
aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
ui::EventHandler* event_handler = GetEventHandler();
- gfx::Rect tooltip_rect = GetTooltipWidget()->GetNativeWindow()->bounds();
+ auto tooltip_rect =
+ gfx::RectF(GetTooltipWidget()->GetNativeWindow()->bounds());
ASSERT_FALSE(tooltip_rect.IsEmpty());
// Shouldn't hide if the mouse is in the tooltip.
@@ -242,7 +243,7 @@ TEST_F(ShelfTooltipManagerTest, HideForMouseMoveEvent) {
EXPECT_TRUE(TooltipIsVisible());
// Should hide if the mouse is out of the tooltip.
- test_api.set_location(tooltip_rect.origin() + gfx::Vector2d(-1, -1));
+ test_api.set_location(tooltip_rect.origin() + gfx::Vector2dF(-1.f, -1.f));
event_handler->OnMouseEvent(&mouse_event);
EXPECT_FALSE(mouse_event.handled());
RunAllPendingInMessageLoop();
@@ -261,9 +262,10 @@ TEST_F(ShelfTooltipManagerTest, HideForMouseClickEvent) {
ASSERT_FALSE(tooltip_rect.IsEmpty());
// Should hide if the mouse is pressed in the tooltip.
- ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, tooltip_rect.CenterPoint(),
- tooltip_rect.CenterPoint(), ui::EventTimeForNow(),
- ui::EF_NONE, ui::EF_NONE);
+ ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED,
+ gfx::PointF(tooltip_rect.CenterPoint()),
+ gfx::PointF(tooltip_rect.CenterPoint()),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
SetEventTarget(root_window, &mouse_event);
event_handler->OnMouseEvent(&mouse_event);
@@ -276,7 +278,8 @@ TEST_F(ShelfTooltipManagerTest, HideForMouseClickEvent) {
ASSERT_TRUE(TooltipIsVisible());
ui::LocatedEventTestApi test_api(&mouse_event);
- test_api.set_location(tooltip_rect.origin() + gfx::Vector2d(-1, -1));
+ test_api.set_location(gfx::PointF(tooltip_rect.origin()) +
+ gfx::Vector2dF(-1.f, -1.f));
SetEventTarget(root_window, &mouse_event);
event_handler->OnMouseEvent(&mouse_event);

Powered by Google App Engine
This is Rietveld 408576698