Index: ash/wm/window_manager_unittest.cc |
diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc |
index eb41fd467d650b4c05d839506a1eb5d46c2e619e..18e50973d919502b8a7958bb875b2064f5c73cd6 100644 |
--- a/ash/wm/window_manager_unittest.cc |
+++ b/ash/wm/window_manager_unittest.cc |
@@ -31,20 +31,33 @@ class TestingCursorClientObserver : public aura::client::CursorClientObserver { |
public: |
TestingCursorClientObserver() |
: cursor_visibility_(false), |
- did_visibility_change_(false) {} |
- void reset() { cursor_visibility_ = did_visibility_change_ = false; } |
+ did_visibility_change_(false), |
+ cursor_set_(ui::CURSOR_SET_NORMAL), |
+ did_cursor_set_change_(false) {} |
+ void reset() { |
+ cursor_visibility_ = did_visibility_change_ = false; |
sky
2016/06/20 15:27:51
Shouldn't you reset cursor_set_ too?
yoshiki
2016/06/28 02:12:42
Done.
|
+ did_cursor_set_change_ = false; |
+ } |
bool is_cursor_visible() const { return cursor_visibility_; } |
+ ui::CursorSetType cursor_set() const { return cursor_set_; } |
bool did_visibility_change() const { return did_visibility_change_; } |
+ bool did_cursor_set_change() const { return did_cursor_set_change_; } |
// Overridden from aura::client::CursorClientObserver: |
void OnCursorVisibilityChanged(bool is_visible) override { |
cursor_visibility_ = is_visible; |
did_visibility_change_ = true; |
} |
+ void OnCursorSetChanged(ui::CursorSetType new_cursor_set) override { |
+ cursor_set_ = new_cursor_set; |
+ did_cursor_set_change_ = true; |
+ } |
private: |
bool cursor_visibility_; |
bool did_visibility_change_; |
+ ui::CursorSetType cursor_set_; |
+ bool did_cursor_set_change_; |
DISALLOW_COPY_AND_ASSIGN(TestingCursorClientObserver); |
}; |
@@ -815,6 +828,10 @@ TEST_F(WindowManagerTest, TestCursorClientObserver) { |
EXPECT_FALSE(observer_b.did_visibility_change()); |
EXPECT_FALSE(observer_a.is_cursor_visible()); |
EXPECT_FALSE(observer_b.is_cursor_visible()); |
+ EXPECT_FALSE(observer_a.did_cursor_set_change()); |
+ EXPECT_FALSE(observer_b.did_cursor_set_change()); |
+ EXPECT_EQ(ui::CURSOR_SET_NORMAL, observer_a.cursor_set()); |
+ EXPECT_EQ(ui::CURSOR_SET_NORMAL, observer_b.cursor_set()); |
// Keypress should hide the cursor. |
generator.PressKey(ui::VKEY_A, ui::EF_NONE); |
@@ -823,6 +840,13 @@ TEST_F(WindowManagerTest, TestCursorClientObserver) { |
EXPECT_FALSE(observer_a.is_cursor_visible()); |
EXPECT_FALSE(observer_b.is_cursor_visible()); |
+ // Set cursor set. |
+ cursor_manager->SetCursorSet(ui::CURSOR_SET_LARGE); |
+ EXPECT_TRUE(observer_a.did_cursor_set_change()); |
+ EXPECT_TRUE(observer_b.did_cursor_set_change()); |
+ EXPECT_EQ(ui::CURSOR_SET_LARGE, observer_a.cursor_set()); |
+ EXPECT_EQ(ui::CURSOR_SET_LARGE, observer_b.cursor_set()); |
+ |
// Mouse move should show the cursor. |
observer_a.reset(); |
observer_b.reset(); |
@@ -844,6 +868,13 @@ TEST_F(WindowManagerTest, TestCursorClientObserver) { |
EXPECT_FALSE(observer_b.did_visibility_change()); |
EXPECT_FALSE(observer_a.is_cursor_visible()); |
+ // Set back cursor set to normal. |
+ cursor_manager->SetCursorSet(ui::CURSOR_SET_NORMAL); |
+ EXPECT_TRUE(observer_a.did_cursor_set_change()); |
+ EXPECT_FALSE(observer_b.did_cursor_set_change()); |
+ EXPECT_EQ(ui::CURSOR_SET_NORMAL, observer_a.cursor_set()); |
+ EXPECT_EQ(ui::CURSOR_SET_LARGE, observer_b.cursor_set()); |
+ |
// Mouse move should show the cursor. |
observer_a.reset(); |
observer_b.reset(); |