| 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 9a5169578182dc7b713777d1ad1dd6c4e291c126..b66cf6a72ca989a8d7a5a2c6c32a3039674fd0e6 100644
|
| --- a/services/ui/ws/window_manager_state_unittest.cc
|
| +++ b/services/ui/ws/window_manager_state_unittest.cc
|
| @@ -385,7 +385,7 @@ TEST_F(WindowManagerStateTest, DontSendQueuedEventsToADeadTree) {
|
| EF_LEFT_MOUSE_BUTTON);
|
| DispatchInputEventToWindow(target, press, nullptr);
|
| ASSERT_EQ(1u, tracker->changes()->size());
|
| - EXPECT_EQ("InputEvent window=1,1 event_action=1",
|
| + EXPECT_EQ("InputEvent window=1,1 event_action=1 event_root_location=5,5",
|
| ChangesToDescription1(*tracker->changes())[0]);
|
| tracker->changes()->clear();
|
| // The above is not setting TreeAwaitingInputAck.
|
| @@ -588,6 +588,29 @@ TEST_F(WindowManagerStateTest, CursorResetOverNoTarget) {
|
| EXPECT_EQ(ui::mojom::Cursor::POINTER, display_test_api.last_cursor());
|
| }
|
|
|
| +TEST_F(WindowManagerStateTest, RootLocationCoordinateConversion) {
|
| + TestWindowTreeClient* embed_connection = nullptr;
|
| + WindowTree* target_tree = nullptr;
|
| + ServerWindow* target = nullptr;
|
| + window()->SetBounds(gfx::Rect(10, 10, 100, 100));
|
| + CreateSecondaryTree(&embed_connection, &target_tree, &target);
|
| + TestWindowManager target_window_manager;
|
| + WindowTreeTestApi(target_tree)
|
| + .set_window_manager_internal(&target_window_manager);
|
| +
|
| + const gfx::Point event_location(40, 50);
|
| + const gfx::Point event_root_location(30, 40);
|
| + ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, event_location, event_root_location,
|
| + base::TimeTicks(), 0, 0);
|
| + std::unique_ptr<Accelerator> accelerator = CreateAccelerator();
|
| + DispatchInputEventToWindow(target, mouse, accelerator.get());
|
| + TestChangeTracker* tracker = embed_connection->tracker();
|
| + ASSERT_EQ(1u, tracker->changes()->size());
|
| + EXPECT_EQ("InputEvent window=2,1 event_action=4 event_root_location=20,30",
|
| + ChangesToDescription1(*tracker->changes())[0]);
|
| + EXPECT_TRUE(wm_client()->tracker()->changes()->empty());
|
| +}
|
| +
|
| } // namespace test
|
| } // namespace ws
|
| } // namespace ui
|
|
|