Index: components/mus/ws/window_tree_apptest.cc |
diff --git a/components/mus/ws/window_tree_apptest.cc b/components/mus/ws/window_tree_apptest.cc |
index 70613fc1f9692880ce6c8c509a7a9f0e12b47f1e..8d04142443245938c448aa0613e52daa070df507 100644 |
--- a/components/mus/ws/window_tree_apptest.cc |
+++ b/components/mus/ws/window_tree_apptest.cc |
@@ -353,6 +353,10 @@ class TestWindowTreeClientImpl : public mojom::WindowTreeClient, |
} |
// TODO(sky): add testing coverage. |
void OnWindowFocused(uint32_t focused_window_id) override {} |
+ void OnWindowCursorChanged(uint32 window_id, |
+ mojom::Cursor cursor_id) override { |
+ tracker_.OnWindowCursorChanged(window_id, cursor_id); |
+ } |
void OnChangeCompleted(uint32_t change_id, bool success) override { |
if (waiting_change_id_ == change_id && change_completed_run_loop_) { |
on_change_completed_result_ = success; |
@@ -1415,6 +1419,20 @@ TEST_F(WindowTreeAppTest, SetWindowVisibility) { |
} |
} |
+// Test that we hear the cursor change in other connections. |
+TEST_F(WindowTreeAppTest, SetCursor) { |
+ // Get a second connection to listen in. |
+ ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(true)); |
+ Id window_1_1 = BuildWindowId(connection_id_1(), 1); |
+ changes2()->clear(); |
+ |
+ ws1()->SetStandardCursor(window_1_1, mojom::Cursor::CURSOR_IBEAM); |
+ ws_client2_->WaitForChangeCount(1u); |
+ |
+ EXPECT_EQ("CursorChanged id=" + IdToString(window_1_1) + " cursor_id=4", |
+ SingleChangeToDescription(*changes2())); |
+} |
+ |
// Assertions for SetWindowVisibility sending notifications. |
TEST_F(WindowTreeAppTest, SetWindowVisibilityNotifications) { |
// Create 1,1 and 1,2. 1,2 is made a child of 1,1 and 1,1 a child of the root. |