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

Unified Diff: services/ui/ws/window_manager_state_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: services/ui/ws/window_manager_state_unittest.cc
diff --git a/services/ui/ws/window_manager_state_unittest.cc b/services/ui/ws/window_manager_state_unittest.cc
index a4856df6d13ff38b2810a29c9a1fd95fbd0d8514..2c73c14426c6a6310714e20c7c646173bde9172f 100644
--- a/services/ui/ws/window_manager_state_unittest.cc
+++ b/services/ui/ws/window_manager_state_unittest.cc
@@ -453,9 +453,10 @@ TEST_F(WindowManagerStateTest, DontSendQueuedEventsToADeadTree) {
ServerWindow* target = window();
TestChangeTracker* tracker = window_tree_client()->tracker();
- ui::MouseEvent press(ui::ET_MOUSE_PRESSED, gfx::Point(5, 5), gfx::Point(5, 5),
- base::TimeTicks(), EF_LEFT_MOUSE_BUTTON,
- EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent press(
+ ui::ET_MOUSE_PRESSED, gfx::Point(5, 5), gfx::Point(5, 5),
+ base::TimeTicks(), EF_LEFT_MOUSE_BUTTON, EF_LEFT_MOUSE_BUTTON,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchInputEventToWindow(target, press, nullptr);
ASSERT_EQ(1u, tracker->changes()->size());
EXPECT_EQ("InputEvent window=1,1 event_action=1",
@@ -465,9 +466,10 @@ TEST_F(WindowManagerStateTest, DontSendQueuedEventsToADeadTree) {
// Queue the key release event; it should not be immediately dispatched
// because there's no ACK for the last one.
- ui::MouseEvent release(ui::ET_MOUSE_RELEASED, gfx::Point(5, 5),
- gfx::Point(5, 5), base::TimeTicks(),
- EF_LEFT_MOUSE_BUTTON, EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent release(
+ ui::ET_MOUSE_RELEASED, gfx::Point(5, 5), gfx::Point(5, 5),
+ base::TimeTicks(), EF_LEFT_MOUSE_BUTTON, EF_LEFT_MOUSE_BUTTON,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchInputEventToWindow(target, release, nullptr);
EXPECT_EQ(0u, tracker->changes()->size());
@@ -514,8 +516,9 @@ TEST_F(WindowManagerStateTest, InterceptingEmbedderReceivesEvents) {
ASSERT_TRUE(embed_client_proxy);
// Send an event to the embed window. It should go to the embedded client.
- ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(),
- base::TimeTicks(), 0, 0);
+ ui::MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), base::TimeTicks(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchInputEventToWindow(embedder_window, mouse, nullptr);
ASSERT_EQ(1u, embed_client_proxy->tracker()->changes()->size());
EXPECT_EQ(CHANGE_TYPE_INPUT_EVENT,
@@ -537,8 +540,9 @@ TEST_F(WindowManagerStateTest, InterceptingEmbedderReceivesEvents) {
// Send an event to the embed window. But this time, it should reach the
// embedder.
- ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(),
- base::TimeTicks(), 0, 0);
+ ui::MouseEvent mouse(
+ ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), base::TimeTicks(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchInputEventToWindow(embedder_window, mouse, nullptr);
ASSERT_EQ(0u, embed_client_proxy->tracker()->changes()->size());
ASSERT_EQ(1u, embedder_client->tracker()->changes()->size());
@@ -569,8 +573,9 @@ TEST_F(WindowManagerStateTest, InterceptingEmbedderReceivesEvents) {
ServerWindow* nested_embed_window =
embed_tree->GetWindowByClientId(nested_embed_window_id);
DCHECK(nested_embed_window->parent());
- mouse = ui::MouseEvent(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(),
- base::TimeTicks(), 0, 0);
+ mouse = ui::MouseEvent(
+ ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), base::TimeTicks(), 0, 0,
+ ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
DispatchInputEventToWindow(nested_embed_window, mouse, nullptr);
ASSERT_EQ(0u, nested_embed_client_proxy->tracker()->changes()->size());
ASSERT_EQ(0u, embed_client_proxy->tracker()->changes()->size());

Powered by Google App Engine
This is Rietveld 408576698