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

Unified Diff: ui/views/controls/table/table_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: 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 e7d9f87fef474510b63479b66da42f4a8c5e27a6..0dcc6fc41ca483b155073a811ce4d2c6bb7dab94 100644
--- a/ui/views/controls/table/table_view_unittest.cc
+++ b/ui/views/controls/table/table_view_unittest.cc
@@ -198,10 +198,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::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
table_->OnMousePressed(pressed);
}
@@ -296,14 +297,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::PointerEventDetails(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::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
helper_->header()->OnMouseDragged(dragged);
// This should shrink the first column and pull the second column in.
@@ -394,16 +396,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::PointerEventDetails(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::PointerEventDetails(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