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

Unified Diff: ash/wm/window_manager_unittest.cc

Issue 960073002: Do not hide the cursor on a key up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « ash/wm/cursor_manager_chromeos.cc ('k') | no next file » | no next file with comments »
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 91fc7dd7f1c2da434e4075051bb35ce8423b7efc..4c0552d53155fa88530af23c083a00b42d62dc54 100644
--- a/ash/wm/window_manager_unittest.cc
+++ b/ash/wm/window_manager_unittest.cc
@@ -770,16 +770,35 @@ TEST_F(WindowManagerTest, UpdateCursorVisibilityOnKeyEvent) {
generator.MoveMouseTo(gfx::Point(0, 0));
EXPECT_TRUE(cursor_manager->IsCursorVisible());
EXPECT_TRUE(cursor_manager->IsMouseEventsEnabled());
- // Releasing a key also hides the cursor but does not disable mouse events.
+ // Releasing a key does does not hide the cursor and does not disable mouse
+ // events.
generator.ReleaseKey(ui::VKEY_A, ui::EF_NONE);
- EXPECT_FALSE(cursor_manager->IsCursorVisible());
- EXPECT_TRUE(cursor_manager->IsMouseEventsEnabled());
- // Moving mouse shows the cursor again.
- generator.MoveMouseTo(gfx::Point(0, 0));
EXPECT_TRUE(cursor_manager->IsCursorVisible());
EXPECT_TRUE(cursor_manager->IsMouseEventsEnabled());
}
+// Test that pressing an accelerator does not hide the cursor.
+TEST_F(WindowManagerTest, UpdateCursorVisibilityAccelerator) {
+ ui::test::EventGenerator& generator = GetEventGenerator();
+ ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager();
+
+ ASSERT_TRUE(cursor_manager->IsCursorVisible());
+
+ // Press Ctrl+A, release A first.
+ generator.PressKey(ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN);
+ generator.PressKey(ui::VKEY_A, ui::EF_CONTROL_DOWN);
+ generator.ReleaseKey(ui::VKEY_A, ui::EF_CONTROL_DOWN);
+ generator.ReleaseKey(ui::VKEY_CONTROL, ui::EF_NONE);
+ EXPECT_TRUE(cursor_manager->IsCursorVisible());
+
+ // Press Ctrl+A, release Ctrl first.
+ generator.PressKey(ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN);
+ generator.PressKey(ui::VKEY_A, ui::EF_CONTROL_DOWN);
+ generator.ReleaseKey(ui::VKEY_CONTROL, ui::EF_NONE);
+ generator.ReleaseKey(ui::VKEY_A, ui::EF_NONE);
+ EXPECT_TRUE(cursor_manager->IsCursorVisible());
+}
+
TEST_F(WindowManagerTest, TestCursorClientObserver) {
ui::test::EventGenerator& generator = GetEventGenerator();
::wm::CursorManager* cursor_manager =
« no previous file with comments | « ash/wm/cursor_manager_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698