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

Unified Diff: chrome/browser/ui/ash/event_rewriter_unittest.cc

Issue 13008005: Short-term fix for CapsLock remapping on chromebooks with external keyboard (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Keep existing pref name Created 7 years, 7 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 | « chrome/browser/ui/ash/event_rewriter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/event_rewriter_unittest.cc
diff --git a/chrome/browser/ui/ash/event_rewriter_unittest.cc b/chrome/browser/ui/ash/event_rewriter_unittest.cc
index 9b1b7aa880af72a0977f08b255c0e9a7b93dcd13..f908c64557f76bd3f176b030fdb3b68bc0c7ac42 100644
--- a/chrome/browser/ui/ash/event_rewriter_unittest.cc
+++ b/chrome/browser/ui/ash/event_rewriter_unittest.cc
@@ -1588,7 +1588,7 @@ TEST_F(EventRewriterTest, TestRewriteModifiersRemapToCapsLock) {
// Caps Lock state, not ash::EventRewriter.
EXPECT_FALSE(xkeyboard.caps_lock_is_enabled_);
- // Press Caps Lock (on an external keyboard).
+ // Release Caps Lock (on an external keyboard).
EXPECT_EQ(GetExpectedResultAsString(ui::VKEY_CAPITAL,
ui::EF_NONE,
ui::ET_KEY_RELEASED,
@@ -1634,39 +1634,6 @@ TEST_F(EventRewriterTest, DISABLED_TestRewriteCapsLock) {
EXPECT_TRUE(xkeyboard.caps_lock_is_enabled_);
}
-TEST_F(EventRewriterTest, DISABLED_TestRewriteCapsLockWithFlag) {
- // TODO(yusukes): Reenable the test once build servers are upgraded.
- TestingPrefServiceSyncable prefs;
- chromeos::Preferences::RegisterUserPrefs(prefs.registry());
-
- chromeos::input_method::MockXKeyboard xkeyboard;
- EventRewriter rewriter;
- rewriter.set_pref_service_for_testing(&prefs);
- rewriter.set_xkeyboard_for_testing(&xkeyboard);
- EXPECT_FALSE(xkeyboard.caps_lock_is_enabled_);
-
- // F16 should work as CapsLock even when --has-chromeos-keyboard is specified.
- const CommandLine original_cl(*CommandLine::ForCurrentProcess());
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kHasChromeOSKeyboard, "");
-
- EXPECT_EQ(GetExpectedResultAsString(ui::VKEY_CAPITAL,
- ui::EF_CAPS_LOCK_DOWN,
- ui::ET_KEY_PRESSED,
- keycode_caps_lock_,
- 0U,
- KeyPress),
- GetRewrittenEventAsString(&rewriter,
- ui::VKEY_F16,
- 0,
- ui::ET_KEY_PRESSED,
- keycode_launch7_,
- 0U));
- EXPECT_TRUE(xkeyboard.caps_lock_is_enabled_);
-
- *CommandLine::ForCurrentProcess() = original_cl;
-}
-
TEST_F(EventRewriterTest, DISABLED_TestRewriteDiamondKey) {
// TODO(yusukes): Reenable the test once build servers are upgraded.
@@ -1856,52 +1823,6 @@ TEST_F(EventRewriterTest, TestRewriteCapsLockToControl) {
Mod1Mask | Mod3Mask));
}
-TEST_F(EventRewriterTest, DISABLED_TestRewriteCapsLockToControlWithFlag) {
- // TODO(yusukes): Reenable the test once build servers are upgraded.
- TestingPrefServiceSyncable prefs;
- chromeos::Preferences::RegisterUserPrefs(prefs.registry());
- IntegerPrefMember control;
- control.Init(prefs::kLanguageRemapCapsLockKeyTo, &prefs);
- control.SetValue(chromeos::input_method::kControlKey);
-
- EventRewriter rewriter;
- rewriter.set_pref_service_for_testing(&prefs);
-
- // The prefs::kLanguageRemapCapsLockKeyTo pref should be ignored when
- // --has-chromeos-keyboard is set.
- const CommandLine original_cl(*CommandLine::ForCurrentProcess());
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kHasChromeOSKeyboard, "");
-
- EXPECT_EQ(GetExpectedResultAsString(ui::VKEY_CAPITAL,
- ui::EF_CAPS_LOCK_DOWN,
- ui::ET_KEY_PRESSED,
- keycode_caps_lock_,
- 0U,
- KeyPress),
- GetRewrittenEventAsString(&rewriter,
- ui::VKEY_F16,
- 0,
- ui::ET_KEY_PRESSED,
- keycode_launch7_,
- 0U));
-
- EXPECT_EQ(GetExpectedResultAsString(ui::VKEY_A,
- 0,
- ui::ET_KEY_PRESSED,
- keycode_a_,
- Mod3Mask,
- KeyPress),
- GetRewrittenEventAsString(&rewriter,
- ui::VKEY_A,
- 0,
- ui::ET_KEY_PRESSED,
- keycode_a_,
- Mod3Mask));
-
- *CommandLine::ForCurrentProcess() = original_cl;
-}
-
TEST_F(EventRewriterTest, TestRewriteCapsLockMod3InUse) {
// Remap CapsLock to Control.
TestingPrefServiceSyncable prefs;
« no previous file with comments | « chrome/browser/ui/ash/event_rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698