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

Unified Diff: ash/drag_drop/drag_drop_controller_unittest.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 9 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/drag_drop/drag_drop_controller_unittest.cc
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc
index 7d96d99198d69e5268b49800e6a00bf0d852bfab..fa74ca793d7bd70c3eff1824ecb323f9f313068a 100644
--- a/ash/drag_drop/drag_drop_controller_unittest.cc
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -687,8 +687,10 @@ TEST_F(DragDropControllerTest, SyntheticEventsDuringDragDrop) {
// EventGenerator since it implicitly turns these into mouse drag events.
// The DragDropController should simply ignore these events.
gfx::Point mouse_move_location = drag_view->bounds().CenterPoint();
- ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, mouse_move_location,
- mouse_move_location, ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent mouse_move(
+ ui::ET_MOUSE_MOVED, mouse_move_location, mouse_move_location,
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = Shell::GetPrimaryRootWindow()
->GetHost()
->event_sink()
@@ -959,15 +961,17 @@ TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) {
GetDragImageWindow()->AddObserver(&observer);
{
- ui::MouseEvent e(ui::ET_MOUSE_DRAGGED, gfx::Point(200, 0),
- gfx::Point(200, 0), ui::EventTimeForNow(), ui::EF_NONE,
- ui::EF_NONE);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_DRAGGED, gfx::Point(200, 0), gfx::Point(200, 0),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
drag_drop_controller_->DragUpdate(window, e);
}
{
- ui::MouseEvent e(ui::ET_MOUSE_DRAGGED, gfx::Point(600, 0),
- gfx::Point(600, 0), ui::EventTimeForNow(), ui::EF_NONE,
- ui::EF_NONE);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_DRAGGED, gfx::Point(600, 0), gfx::Point(600, 0),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
drag_drop_controller_->DragUpdate(window, e);
}
@@ -989,15 +993,17 @@ TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) {
GetDragImageWindow()->AddObserver(&observer);
{
- ui::MouseEvent e(ui::ET_MOUSE_DRAGGED, gfx::Point(600, 0),
- gfx::Point(600, 0), ui::EventTimeForNow(), ui::EF_NONE,
- ui::EF_NONE);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_DRAGGED, gfx::Point(600, 0), gfx::Point(600, 0),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
drag_drop_controller_->DragUpdate(window, e);
}
{
- ui::MouseEvent e(ui::ET_MOUSE_DRAGGED, gfx::Point(200, 0),
- gfx::Point(200, 0), ui::EventTimeForNow(), ui::EF_NONE,
- ui::EF_NONE);
+ ui::MouseEvent e(
+ ui::ET_MOUSE_DRAGGED, gfx::Point(200, 0), gfx::Point(200, 0),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
drag_drop_controller_->DragUpdate(window, e);
}
@@ -1028,17 +1034,19 @@ TEST_F(DragDropControllerTest, DragCancelOnDisplayDisconnect) {
ui::DragDropTypes::DRAG_MOVE, ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE);
// Start dragging.
- ui::MouseEvent e1(ui::ET_MOUSE_DRAGGED, gfx::Point(200, 0),
- gfx::Point(200, 0), ui::EventTimeForNow(), ui::EF_NONE,
- ui::EF_NONE);
+ ui::MouseEvent e1(
+ ui::ET_MOUSE_DRAGGED, gfx::Point(200, 0), gfx::Point(200, 0),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
drag_drop_controller_->DragUpdate(window, e1);
EXPECT_TRUE(drag_drop_controller_->drag_start_received_);
EXPECT_TRUE(drag_drop_controller_->IsDragDropInProgress());
// Drag onto the secondary display.
- ui::MouseEvent e2(ui::ET_MOUSE_DRAGGED, gfx::Point(600, 0),
- gfx::Point(600, 0), ui::EventTimeForNow(), ui::EF_NONE,
- ui::EF_NONE);
+ ui::MouseEvent e2(
+ ui::ET_MOUSE_DRAGGED, gfx::Point(600, 0), gfx::Point(600, 0),
+ ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
drag_drop_controller_->DragUpdate(window, e2);
EXPECT_TRUE(drag_drop_controller_->IsDragDropInProgress());

Powered by Google App Engine
This is Rietveld 408576698