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

Unified Diff: ui/wm/core/compound_event_filter_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
« ui/events/event.h ('K') | « ui/wm/core/capture_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/compound_event_filter_unittest.cc
diff --git a/ui/wm/core/compound_event_filter_unittest.cc b/ui/wm/core/compound_event_filter_unittest.cc
index 4ffdd26fa44a9e5f7af34960c40e1a6bd2c85c13..038238a428956eae157bdbce79c22a63aaf1e903 100644
--- a/ui/wm/core/compound_event_filter_unittest.cc
+++ b/ui/wm/core/compound_event_filter_unittest.cc
@@ -67,21 +67,27 @@ TEST_F(CompoundEventFilterTest, CursorVisibilityChange) {
EXPECT_FALSE(cursor_client.IsCursorVisible());
// Synthesized mouse event should not show the cursor.
- ui::MouseEvent enter(ui::ET_MOUSE_ENTERED, gfx::Point(10, 10),
- gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent enter(
+ ui::ET_MOUSE_ENTERED, gfx::Point(10, 10), gfx::Point(10, 10),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
enter.set_flags(enter.flags() | ui::EF_IS_SYNTHESIZED);
DispatchEventUsingWindowDispatcher(&enter);
EXPECT_FALSE(cursor_client.IsCursorVisible());
- ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
- gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move(
+ ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
move.set_flags(enter.flags() | ui::EF_IS_SYNTHESIZED);
DispatchEventUsingWindowDispatcher(&move);
EXPECT_FALSE(cursor_client.IsCursorVisible());
// A real mouse event should show the cursor.
- ui::MouseEvent real_move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
- gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent real_move(
+ ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchEventUsingWindowDispatcher(&real_move);
EXPECT_TRUE(cursor_client.IsCursorVisible());
@@ -98,8 +104,10 @@ TEST_F(CompoundEventFilterTest, CursorVisibilityChange) {
EXPECT_FALSE(cursor_client.IsCursorVisible());
// Mouse synthesized exit event should not show the cursor.
- ui::MouseEvent exit(ui::ET_MOUSE_EXITED, gfx::Point(10, 10),
- gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent exit(
+ ui::ET_MOUSE_EXITED, gfx::Point(10, 10), gfx::Point(10, 10),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
exit.set_flags(enter.flags() | ui::EF_IS_SYNTHESIZED);
DispatchEventUsingWindowDispatcher(&exit);
EXPECT_FALSE(cursor_client.IsCursorVisible());
@@ -122,8 +130,10 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
aura::test::TestCursorClient cursor_client(root_window());
- ui::MouseEvent mouse0(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
- gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent mouse0(
+ ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchEventUsingWindowDispatcher(&mouse0);
EXPECT_TRUE(cursor_client.IsMouseEventsEnabled());
@@ -143,8 +153,10 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
DispatchEventUsingWindowDispatcher(&release);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
- ui::MouseEvent mouse1(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
- gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent mouse1(
+ ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
// Move the cursor again. The cursor should be visible.
DispatchEventUsingWindowDispatcher(&mouse1);
EXPECT_TRUE(cursor_client.IsMouseEventsEnabled());
@@ -230,8 +242,10 @@ TEST_F(CompoundEventFilterTest, DontShowCursorOnMouseMovesFromTouch) {
cursor_client.DisableMouseEvents();
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
- ui::MouseEvent mouse0(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
- gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent mouse0(
+ ui::ET_MOUSE_MOVED, gfx::Point(10, 10), gfx::Point(10, 10),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
mouse0.set_flags(mouse0.flags() | ui::EF_FROM_TOUCH);
DispatchEventUsingWindowDispatcher(&mouse0);
« ui/events/event.h ('K') | « ui/wm/core/capture_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698