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

Unified Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 11113004: Do not consume keys for DISABLE_CAPS_LOCK when caps lock is off. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test Created 8 years, 2 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/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 fca81ff9cb343ddf3b3873c2253094dbfe056688..ad9170701f131e926c947c8379208eb38743f726 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -627,6 +627,21 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
EXPECT_FALSE(GetController()->Process(
ReleaseAccelerator(ui::VKEY_A, ui::EF_SHIFT_DOWN)));
EXPECT_TRUE(delegate->IsCapsLockEnabled());
+
+ // Do not consume shift keyup when caps lock is off.
+ delegate->SetCapsLockEnabled(false);
+ EXPECT_FALSE(GetController()->Process(
+ ui::Accelerator(ui::VKEY_LSHIFT, ui::EF_NONE)));
+ EXPECT_FALSE(GetController()->Process(
+ ReleaseAccelerator(ui::VKEY_LSHIFT, ui::EF_NONE)));
+ EXPECT_FALSE(GetController()->Process(
+ ui::Accelerator(ui::VKEY_RSHIFT, ui::EF_NONE)));
+ EXPECT_FALSE(GetController()->Process(
+ ReleaseAccelerator(ui::VKEY_RSHIFT, ui::EF_NONE)));
+ EXPECT_FALSE(GetController()->Process(
+ ui::Accelerator(ui::VKEY_SHIFT, ui::EF_NONE)));
+ EXPECT_FALSE(GetController()->Process(
+ ReleaseAccelerator(ui::VKEY_SHIFT, ui::EF_NONE)));
}
// ToggleCapsLock
{
« 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