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

Unified Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 2763483002: Fix Caps Lock bug (Closed)
Patch Set: Failure due to file directory change, apply the fix Created 3 years, 8 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') | ash/accelerators/accelerator_table.cc » ('j') | 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 32d2df9d047bc1edec1aee974d3ab10ef658778f..bcda4b636463eb6b7da6fb12faf2aebcbfbdc251 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -980,7 +980,7 @@ class ToggleCapsLockTest : public AcceleratorControllerTest {
DISALLOW_COPY_AND_ASSIGN(ToggleCapsLockTest);
};
-// Tests the four combinations of the TOGGLE_CAPS_LOCK accelerator.
+// Tests the five combinations of the TOGGLE_CAPS_LOCK accelerator.
TEST_F(ToggleCapsLockTest, ToggleCapsLockAccelerators) {
chromeos::input_method::InputMethodManager* input_method_manager =
chromeos::input_method::InputMethodManager::Get();
@@ -1020,6 +1020,16 @@ TEST_F(ToggleCapsLockTest, ToggleCapsLockAccelerators) {
EXPECT_FALSE(ProcessInController(press_search_then_alt));
EXPECT_TRUE(ProcessInController(release_alt_before_search));
EXPECT_TRUE(input_method_manager->GetImeKeyboard()->CapsLockIsEnabled());
+ input_method_manager->GetImeKeyboard()->SetCapsLockEnabled(false);
+
+ // 5. Press Caps Lock, Release Caps Lock.
+ const ui::Accelerator press_caps_lock(ui::VKEY_CAPITAL, ui::EF_NONE);
+ EXPECT_FALSE(ProcessInController(press_caps_lock));
+ EXPECT_FALSE(input_method_manager->GetImeKeyboard()->CapsLockIsEnabled());
+ const ui::Accelerator release_caps_lock(
+ CreateReleaseAccelerator(ui::VKEY_CAPITAL, ui::EF_NONE));
+ EXPECT_TRUE(ProcessInController(release_caps_lock));
+ EXPECT_TRUE(input_method_manager->GetImeKeyboard()->CapsLockIsEnabled());
}
class PreferredReservedAcceleratorsTest : public test::AshTestBase {
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/accelerators/accelerator_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698