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

Unified Diff: ash/wm/window_manager_unittest.cc

Issue 2071553002: Initial support of large mouse cursor on Exosphere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for comment #13 Created 4 years, 6 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
« no previous file with comments | « no previous file | components/exo/pointer.h » ('j') | ui/aura/client/cursor_client_observer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | components/exo/pointer.h » ('j') | ui/aura/client/cursor_client_observer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698