| Index: ash/shelf/shelf_view_unittest.cc
|
| diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
|
| index a74979adc60c7587c4f460140e11444b65644860..f2219448b36f840899ec830adbe1ee56f8076e12 100644
|
| --- a/ash/shelf/shelf_view_unittest.cc
|
| +++ b/ash/shelf/shelf_view_unittest.cc
|
| @@ -443,9 +443,10 @@ class ShelfViewTest : public AshTestBase {
|
| int button_index) {
|
| ShelfButtonHost* button_host = shelf_view_;
|
| ShelfButton* button = test_api_->GetButton(button_index);
|
| - ui::MouseEvent click_event(ui::ET_MOUSE_PRESSED, gfx::Point(),
|
| - button->GetBoundsInScreen().origin(),
|
| - ui::EventTimeForNow(), 0, 0);
|
| + ui::MouseEvent click_event(
|
| + ui::ET_MOUSE_PRESSED, gfx::PointF(),
|
| + gfx::PointF(button->GetBoundsInScreen().origin()),
|
| + ui::EventTimeForNow(), 0, 0);
|
| button_host->PointerPressedOnButton(button, pointer, click_event);
|
| return button;
|
| }
|
| @@ -455,9 +456,10 @@ class ShelfViewTest : public AshTestBase {
|
| ShelfButtonHost* button_host = shelf_view_;
|
| ShelfButton* button =
|
| SimulateButtonPressed(ShelfButtonHost::MOUSE, button_index);
|
| - ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, gfx::Point(),
|
| - button->GetBoundsInScreen().origin(),
|
| - ui::EventTimeForNow(), 0, 0);
|
| + ui::MouseEvent release_event(
|
| + ui::ET_MOUSE_RELEASED, gfx::PointF(),
|
| + gfx::PointF(button->GetBoundsInScreen().origin()),
|
| + ui::EventTimeForNow(), 0, 0);
|
| test_api_->ButtonPressed(button, release_event);
|
| button_host->PointerReleasedOnButton(button, ShelfButtonHost::MOUSE, false);
|
| }
|
| @@ -467,10 +469,10 @@ class ShelfViewTest : public AshTestBase {
|
| ShelfButtonHost* button_host = shelf_view_;
|
| ShelfButton* button =
|
| SimulateButtonPressed(ShelfButtonHost::MOUSE, button_index);
|
| - ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, gfx::Point(),
|
| - button->GetBoundsInScreen().origin(),
|
| - ui::EventTimeForNow(), ui::EF_IS_DOUBLE_CLICK,
|
| - 0);
|
| + ui::MouseEvent release_event(
|
| + ui::ET_MOUSE_RELEASED, gfx::PointF(),
|
| + gfx::PointF(button->GetBoundsInScreen().origin()),
|
| + ui::EventTimeForNow(), ui::EF_IS_DOUBLE_CLICK, 0);
|
| test_api_->ButtonPressed(button, release_event);
|
| button_host->PointerReleasedOnButton(button, ShelfButtonHost::MOUSE, false);
|
| }
|
| @@ -484,9 +486,10 @@ class ShelfViewTest : public AshTestBase {
|
| // Drag.
|
| views::View* destination = test_api_->GetButton(destination_index);
|
| ui::MouseEvent drag_event(
|
| - ui::ET_MOUSE_DRAGGED, gfx::Point(destination->x() - button->x(),
|
| - destination->y() - button->y()),
|
| - destination->GetBoundsInScreen().origin(), ui::EventTimeForNow(), 0, 0);
|
| + ui::ET_MOUSE_DRAGGED, gfx::PointF(destination->x() - button->x(),
|
| + destination->y() - button->y()),
|
| + gfx::PointF(destination->GetBoundsInScreen().origin()),
|
| + ui::EventTimeForNow(), 0, 0);
|
| button_host->PointerDraggedOnButton(button, pointer, drag_event);
|
| return button;
|
| }
|
| @@ -1189,10 +1192,10 @@ TEST_F(ShelfViewTest, ClickAndMoveSlightly) {
|
| shelf_id,
|
| scoped_ptr<ShelfItemDelegate>(selection_tracker).Pass());
|
|
|
| - gfx::Vector2d press_offset(5, 30);
|
| - gfx::Point press_location = gfx::Point() + press_offset;
|
| - gfx::Point press_location_in_screen =
|
| - button->GetBoundsInScreen().origin() + press_offset;
|
| + gfx::Vector2dF press_offset(5.f, 30.f);
|
| + gfx::PointF press_location = gfx::PointF() + press_offset;
|
| + gfx::PointF press_location_in_screen =
|
| + gfx::PointF(button->GetBoundsInScreen().origin()) + press_offset;
|
|
|
| ui::MouseEvent click_event(ui::ET_MOUSE_PRESSED, press_location,
|
| press_location_in_screen, ui::EventTimeForNow(),
|
| @@ -1201,20 +1204,20 @@ TEST_F(ShelfViewTest, ClickAndMoveSlightly) {
|
|
|
| ui::MouseEvent drag_event1(
|
| ui::ET_MOUSE_DRAGGED, press_location + gfx::Vector2d(0, 1),
|
| - press_location_in_screen + gfx::Vector2d(0, 1), ui::EventTimeForNow(),
|
| - ui::EF_LEFT_MOUSE_BUTTON, 0);
|
| + press_location_in_screen + gfx::Vector2dF(0.f, 1.f),
|
| + ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0);
|
| button->OnMouseDragged(drag_event1);
|
|
|
| ui::MouseEvent drag_event2(
|
| ui::ET_MOUSE_DRAGGED, press_location + gfx::Vector2d(-1, 0),
|
| - press_location_in_screen + gfx::Vector2d(-1, 0), ui::EventTimeForNow(),
|
| - ui::EF_LEFT_MOUSE_BUTTON, 0);
|
| + press_location_in_screen + gfx::Vector2dF(-1.f, 0.f),
|
| + ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0);
|
| button->OnMouseDragged(drag_event2);
|
|
|
| ui::MouseEvent release_event(
|
| ui::ET_MOUSE_RELEASED, press_location + gfx::Vector2d(-1, 0),
|
| - press_location_in_screen + gfx::Vector2d(-1, 0), ui::EventTimeForNow(),
|
| - ui::EF_LEFT_MOUSE_BUTTON, 0);
|
| + press_location_in_screen + gfx::Vector2dF(-1.f, 0.f),
|
| + ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0);
|
| button->OnMouseReleased(release_event);
|
|
|
| EXPECT_TRUE(selection_tracker->WasSelected());
|
|
|