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

Unified Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 11419306: Don't disable Caps Lock when Shift+<non-modifier-key> is pressed and Shift is released first. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/accelerators/accelerator_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller_unittest.cc
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index c5ad9b7d31a8d15f7a4ebcdc8b937c6767bf0b61..e4f2b26ea6d1a300fa2597459321afa460c3a3b5 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -666,6 +666,30 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
ReleaseAccelerator(ui::VKEY_A, ui::EF_SHIFT_DOWN)));
EXPECT_TRUE(delegate->IsCapsLockEnabled());
+ // Do not handle when a shift pressed with other keys, and shift is
+ // released first.
+ delegate->SetCapsLockEnabled(true);
+ EXPECT_FALSE(ProcessWithContext(
+ ui::Accelerator(ui::VKEY_A, ui::EF_SHIFT_DOWN)));
+ EXPECT_TRUE(delegate->IsCapsLockEnabled());
+ EXPECT_FALSE(ProcessWithContext(
+ ReleaseAccelerator(ui::VKEY_LSHIFT, ui::EF_NONE)));
+ EXPECT_TRUE(delegate->IsCapsLockEnabled());
+
+ EXPECT_FALSE(ProcessWithContext(
+ ui::Accelerator(ui::VKEY_A, ui::EF_SHIFT_DOWN)));
+ EXPECT_TRUE(delegate->IsCapsLockEnabled());
+ EXPECT_FALSE(ProcessWithContext(
+ ReleaseAccelerator(ui::VKEY_SHIFT, ui::EF_NONE)));
+ EXPECT_TRUE(delegate->IsCapsLockEnabled());
+
+ EXPECT_FALSE(ProcessWithContext(
+ ui::Accelerator(ui::VKEY_A, ui::EF_SHIFT_DOWN)));
+ EXPECT_TRUE(delegate->IsCapsLockEnabled());
+ EXPECT_FALSE(ProcessWithContext(
+ ReleaseAccelerator(ui::VKEY_RSHIFT, ui::EF_NONE)));
+ EXPECT_TRUE(delegate->IsCapsLockEnabled());
+
// Do not consume shift keyup when caps lock is off.
delegate->SetCapsLockEnabled(false);
EXPECT_FALSE(ProcessWithContext(
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698