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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 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_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index a74979adc60c7587c4f460140e11444b65644860..902b747250692c0e7236c476dcd1511ddcc5a86b 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::Point(),
+ button->GetBoundsInScreen().origin(), ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
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::Point(),
+ button->GetBoundsInScreen().origin(), ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
test_api_->ButtonPressed(button, release_event);
button_host->PointerReleasedOnButton(button, ShelfButtonHost::MOUSE, false);
}
@@ -467,10 +469,11 @@ 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::Point(),
+ button->GetBoundsInScreen().origin(), ui::EventTimeForNow(),
+ ui::EF_IS_DOUBLE_CLICK, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
test_api_->ButtonPressed(button, release_event);
button_host->PointerReleasedOnButton(button, ShelfButtonHost::MOUSE, false);
}
@@ -486,7 +489,8 @@ class ShelfViewTest : public AshTestBase {
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);
+ destination->GetBoundsInScreen().origin(), ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
button_host->PointerDraggedOnButton(button, pointer, drag_event);
return button;
}
@@ -1194,27 +1198,31 @@ TEST_F(ShelfViewTest, ClickAndMoveSlightly) {
gfx::Point press_location_in_screen =
button->GetBoundsInScreen().origin() + press_offset;
- ui::MouseEvent click_event(ui::ET_MOUSE_PRESSED, press_location,
- press_location_in_screen, ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON, 0);
+ ui::MouseEvent click_event(
+ ui::ET_MOUSE_PRESSED, press_location, press_location_in_screen,
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
button->OnMousePressed(click_event);
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);
+ ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
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);
+ ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
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);
+ ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
button->OnMouseReleased(release_event);
EXPECT_TRUE(selection_tracker->WasSelected());
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | ash/shelf/shelf_widget_unittest.cc » ('j') | ui/events/event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698