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

Unified Diff: ui/wm/core/cursor_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: . 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
« components/exo/pointer.cc ('K') | « ui/wm/core/cursor_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c55ebe0a1c879fe03ea59a79f73b743f1ae81e49..dd3e537bbf9410f772a233fcb8809b5af727cee6 100644
--- a/ui/wm/core/cursor_manager_unittest.cc
+++ b/ui/wm/core/cursor_manager_unittest.cc
@@ -56,9 +56,11 @@ class TestingCursorClientObserver : public aura::client::CursorClientObserver {
public:
TestingCursorClientObserver()
: cursor_visibility_(false),
- did_visibility_change_(false) {}
+ did_visibility_change_(false),
+ cursor_set_(ui::CURSOR_SET_NORMAL) {}
void reset() { cursor_visibility_ = did_visibility_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_; }
// Overridden from aura::client::CursorClientObserver:
@@ -66,10 +68,14 @@ class TestingCursorClientObserver : public aura::client::CursorClientObserver {
cursor_visibility_ = is_visible;
did_visibility_change_ = true;
}
+ void OnCursorSetChanged(ui::CursorSetType cursor_set) override {
+ cursor_set_ = cursor_set;
+ }
private:
bool cursor_visibility_;
bool did_visibility_change_;
+ ui::CursorSetType cursor_set_;
DISALLOW_COPY_AND_ASSIGN(TestingCursorClientObserver);
};
@@ -175,16 +181,23 @@ TEST_F(CursorManagerTest, EnableDisableMouseEvents) {
}
TEST_F(CursorManagerTest, SetCursorSet) {
+ TestingCursorClientObserver observer;
+ cursor_manager_.AddObserver(&observer);
+
EXPECT_EQ(ui::CURSOR_SET_NORMAL, cursor_manager_.GetCursorSet());
+ EXPECT_EQ(ui::CURSOR_SET_NORMAL, observer.cursor_set());
cursor_manager_.SetCursorSet(ui::CURSOR_SET_NORMAL);
EXPECT_EQ(ui::CURSOR_SET_NORMAL, cursor_manager_.GetCursorSet());
+ EXPECT_EQ(ui::CURSOR_SET_NORMAL, observer.cursor_set());
cursor_manager_.SetCursorSet(ui::CURSOR_SET_LARGE);
EXPECT_EQ(ui::CURSOR_SET_LARGE, cursor_manager_.GetCursorSet());
+ EXPECT_EQ(ui::CURSOR_SET_LARGE, observer.cursor_set());
cursor_manager_.SetCursorSet(ui::CURSOR_SET_NORMAL);
EXPECT_EQ(ui::CURSOR_SET_NORMAL, cursor_manager_.GetCursorSet());
+ EXPECT_EQ(ui::CURSOR_SET_NORMAL, observer.cursor_set());
}
TEST_F(CursorManagerTest, IsMouseEventsEnabled) {
« components/exo/pointer.cc ('K') | « ui/wm/core/cursor_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698