| Index: ui/wm/core/cursor_manager_unittest.cc
|
| diff --git a/ui/wm/core/cursor_manager_unittest.cc b/ui/wm/core/cursor_manager_unittest.cc
|
| index 7add106969a4d89cc16984676b1325213741a972..e4f5429309a0c12d7ab3a2f01460931ae73d8bc9 100644
|
| --- a/ui/wm/core/cursor_manager_unittest.cc
|
| +++ b/ui/wm/core/cursor_manager_unittest.cc
|
| @@ -325,3 +325,38 @@ TEST_F(CursorManagerTest, TestCursorClientObserver) {
|
| EXPECT_FALSE(observer_b.did_visibility_change());
|
| EXPECT_TRUE(observer_a.is_cursor_visible());
|
| }
|
| +
|
| +// This test validates that the cursor visiblity state is restored when a
|
| +// CursorManager instance is destroyed and recreated.
|
| +TEST(CursorManagerCreateDestroyTest, VisibilityTest) {
|
| + // This block ensures that the cursor is hidden when the CursorManager
|
| + // instance is destroyed.
|
| + {
|
| + wm::CursorManager cursor_manager1(
|
| + scoped_ptr<wm::NativeCursorManager>(new TestingCursorManager));
|
| + cursor_manager1.ShowCursor();
|
| + EXPECT_TRUE(cursor_manager1.IsCursorVisible());
|
| + cursor_manager1.HideCursor();
|
| + EXPECT_FALSE(cursor_manager1.IsCursorVisible());
|
| + }
|
| +
|
| + // This block validates that the cursor is hidden initially. It ensures that
|
| + // the cursor is visible when the CursorManager instance is destroyed.
|
| + {
|
| + wm::CursorManager cursor_manager2(
|
| + scoped_ptr<wm::NativeCursorManager>(new TestingCursorManager));
|
| + EXPECT_FALSE(cursor_manager2.IsCursorVisible());
|
| + cursor_manager2.ShowCursor();
|
| + EXPECT_TRUE(cursor_manager2.IsCursorVisible());
|
| + }
|
| +
|
| + // This block validates that the cursor is visible initially. It then
|
| + // performs normal cursor visibility operations.
|
| + {
|
| + wm::CursorManager cursor_manager3(
|
| + scoped_ptr<wm::NativeCursorManager>(new TestingCursorManager));
|
| + EXPECT_TRUE(cursor_manager3.IsCursorVisible());
|
| + cursor_manager3.HideCursor();
|
| + EXPECT_FALSE(cursor_manager3.IsCursorVisible());
|
| + }
|
| +}
|
|
|