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

Unified Diff: ui/wm/core/compound_event_filter_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
« 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 13e793691ac31034538580399157cb306cb8ca25..c0dc819dca04ee5ca92dc4264bb3317180e618c5 100644
--- a/ui/wm/core/compound_event_filter_unittest.cc
+++ b/ui/wm/core/compound_event_filter_unittest.cc
@@ -69,21 +69,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::PointerDetails(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::PointerDetails(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::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchEventUsingWindowDispatcher(&real_move);
EXPECT_TRUE(cursor_client.IsCursorVisible());
@@ -100,8 +106,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::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
exit.set_flags(enter.flags() | ui::EF_IS_SYNTHESIZED);
DispatchEventUsingWindowDispatcher(&exit);
EXPECT_FALSE(cursor_client.IsCursorVisible());
@@ -124,8 +132,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::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchEventUsingWindowDispatcher(&mouse0);
EXPECT_TRUE(cursor_client.IsMouseEventsEnabled());
@@ -149,8 +159,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::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
// Move the cursor again. The cursor should be visible.
DispatchEventUsingWindowDispatcher(&mouse1);
EXPECT_TRUE(cursor_client.IsMouseEventsEnabled());
@@ -238,8 +250,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::PointerDetails(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