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

Unified Diff: ui/views/controls/table/table_view_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: ui/views/controls/table/table_view_unittest.cc
diff --git a/ui/views/controls/table/table_view_unittest.cc b/ui/views/controls/table/table_view_unittest.cc
index 5c71032e61d3a05b052ff3180785be4c1ebe685b..e81e643fadc5392b348346cf219f9e39f4dc7dad 100644
--- a/ui/views/controls/table/table_view_unittest.cc
+++ b/ui/views/controls/table/table_view_unittest.cc
@@ -224,10 +224,11 @@ class TableViewTest : public testing::Test {
void ClickOnRow(int row, int flags) {
const int y = row * table_->row_height();
- const ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(0, y),
- gfx::Point(0, y), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON | flags,
- ui::EF_LEFT_MOUSE_BUTTON);
+ const ui::MouseEvent pressed(
+ ui::ET_MOUSE_PRESSED, gfx::Point(0, y), gfx::Point(0, y),
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON | flags,
+ ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
table_->OnMousePressed(pressed);
}
@@ -322,14 +323,15 @@ TEST_F(TableViewTest, Resize) {
const int x = table_->visible_columns()[0].width;
EXPECT_NE(0, x);
// Drag the mouse 1 pixel to the left.
- const ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(x, 0),
- gfx::Point(x, 0), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON,
- ui::EF_LEFT_MOUSE_BUTTON);
+ const ui::MouseEvent pressed(
+ ui::ET_MOUSE_PRESSED, gfx::Point(x, 0), gfx::Point(x, 0),
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
helper_->header()->OnMousePressed(pressed);
- const ui::MouseEvent dragged(ui::ET_MOUSE_DRAGGED, gfx::Point(x - 1, 0),
- gfx::Point(x - 1, 0), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON, 0);
+ const ui::MouseEvent dragged(
+ ui::ET_MOUSE_DRAGGED, gfx::Point(x - 1, 0), gfx::Point(x - 1, 0),
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
helper_->header()->OnMouseDragged(dragged);
// This should shrink the first column and pull the second column in.
@@ -494,16 +496,16 @@ TEST_F(TableViewTest, SortOnMouse) {
const int x = table_->visible_columns()[0].width / 2;
EXPECT_NE(0, x);
// Press and release the mouse.
- const ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(x, 0),
- gfx::Point(x, 0), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON,
- ui::EF_LEFT_MOUSE_BUTTON);
+ const ui::MouseEvent pressed(
+ ui::ET_MOUSE_PRESSED, gfx::Point(x, 0), gfx::Point(x, 0),
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
// The header must return true, else it won't normally get the release.
EXPECT_TRUE(helper_->header()->OnMousePressed(pressed));
- const ui::MouseEvent release(ui::ET_MOUSE_RELEASED, gfx::Point(x, 0),
- gfx::Point(x, 0), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON,
- ui::EF_LEFT_MOUSE_BUTTON);
+ const ui::MouseEvent release(
+ ui::ET_MOUSE_RELEASED, gfx::Point(x, 0), gfx::Point(x, 0),
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
helper_->header()->OnMouseReleased(release);
ASSERT_EQ(1u, table_->sort_descriptors().size());

Powered by Google App Engine
This is Rietveld 408576698