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

Unified Diff: chrome/browser/chromeos/input_method/xkeyboard_unittest.cc

Issue 10416028: Rename chromeos::input_method::kLeftControl to chromeos::input_method::kControl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/chromeos/input_method/xkeyboard.cc ('k') | chrome/browser/chromeos/preferences.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/xkeyboard_unittest.cc
diff --git a/chrome/browser/chromeos/input_method/xkeyboard_unittest.cc b/chrome/browser/chromeos/input_method/xkeyboard_unittest.cc
index 3af97678d7c8de722d836a4cc5baff3378e68060..6658b3ae6664506e9624a5eac9a9bb3efdf6c3a7 100644
--- a/chrome/browser/chromeos/input_method/xkeyboard_unittest.cc
+++ b/chrome/browser/chromeos/input_method/xkeyboard_unittest.cc
@@ -51,29 +51,29 @@ class XKeyboardTest : public testing::Test {
// Returns a ModifierMap object that contains the following mapping:
// - kSearchKey is mapped to |search|.
-// - kLeftControl key is mapped to |control|.
-// - kLeftAlt key is mapped to |alt|.
+// - kControl key is mapped to |control|.
+// - kAlt key is mapped to |alt|.
ModifierMap GetMap(ModifierKey search, ModifierKey control, ModifierKey alt) {
ModifierMap modifier_key;
// Use the Search key as |search|.
modifier_key.push_back(ModifierKeyPair(kSearchKey, search));
- modifier_key.push_back(ModifierKeyPair(kLeftControlKey, control));
- modifier_key.push_back(ModifierKeyPair(kLeftAltKey, alt));
+ modifier_key.push_back(ModifierKeyPair(kControlKey, control));
+ modifier_key.push_back(ModifierKeyPair(kAltKey, alt));
return modifier_key;
}
// Checks |modifier_map| and returns true if the following conditions are met:
// - kSearchKey is mapped to |search|.
-// - kLeftControl key is mapped to |control|.
-// - kLeftAlt key is mapped to |alt|.
+// - kControl key is mapped to |control|.
+// - kAlt key is mapped to |alt|.
bool CheckMap(const ModifierMap& modifier_map,
ModifierKey search, ModifierKey control, ModifierKey alt) {
ModifierMap::const_iterator begin = modifier_map.begin();
ModifierMap::const_iterator end = modifier_map.end();
if ((std::count(begin, end, ModifierKeyPair(kSearchKey, search)) == 1) &&
(std::count(begin, end,
- ModifierKeyPair(kLeftControlKey, control)) == 1) &&
- (std::count(begin, end, ModifierKeyPair(kLeftAltKey, alt)) == 1)) {
+ ModifierKeyPair(kControlKey, control)) == 1) &&
+ (std::count(begin, end, ModifierKeyPair(kAltKey, alt)) == 1)) {
return true;
}
return false;
@@ -106,10 +106,10 @@ TEST_F(XKeyboardTest, TestCreateFullXkbLayoutNameBasic) {
tmp_map.push_back(ModifierKeyPair(kSearchKey, kVoidKey)); // two search maps
EXPECT_STREQ("", xkey_->CreateFullXkbLayoutName("us", tmp_map).c_str());
tmp_map = GetMap(kVoidKey, kVoidKey, kVoidKey);
- tmp_map.push_back(ModifierKeyPair(kLeftControlKey, kVoidKey)); // two ctrls
+ tmp_map.push_back(ModifierKeyPair(kControlKey, kVoidKey)); // two ctrls
EXPECT_STREQ("", xkey_->CreateFullXkbLayoutName("us", tmp_map).c_str());
tmp_map = GetMap(kVoidKey, kVoidKey, kVoidKey);
- tmp_map.push_back(ModifierKeyPair(kLeftAltKey, kVoidKey)); // two alts.
+ tmp_map.push_back(ModifierKeyPair(kAltKey, kVoidKey)); // two alts.
EXPECT_STREQ("", xkey_->CreateFullXkbLayoutName("us", tmp_map).c_str());
// CreateFullXkbLayoutName should not accept invalid ModifierMaps.
@@ -182,10 +182,10 @@ TEST_F(XKeyboardTest, TestCreateFullXkbLayoutNameKeepCapsLock) {
GetMap(kVoidKey, kVoidKey, kVoidKey)).c_str());
EXPECT_STREQ("de(neo)+chromeos(search_leftcontrol_leftcontrol_keepralt)",
xkey_->CreateFullXkbLayoutName(
- // The 1st kLeftControlKey should be ignored.
- "de(neo)", GetMap(kLeftControlKey,
- kLeftControlKey,
- kLeftControlKey)).c_str());
+ // The 1st kControlKey should be ignored.
+ "de(neo)", GetMap(kControlKey,
+ kControlKey,
+ kControlKey)).c_str());
EXPECT_STREQ("gb(extd)+chromeos(disabled_disabled_disabled_keepralt)",
xkey_->CreateFullXkbLayoutName(
"gb(extd)",
@@ -199,9 +199,9 @@ TEST_F(XKeyboardTest, TestCreateFullXkbLayoutNameKeepAlt) {
EXPECT_STREQ("kr(kr104)+"
"chromeos(leftcontrol_leftcontrol_leftcontrol_keepralt)",
xkey_->CreateFullXkbLayoutName(
- "kr(kr104)", GetMap(kLeftControlKey,
- kLeftControlKey,
- kLeftControlKey)).c_str());
+ "kr(kr104)", GetMap(kControlKey,
+ kControlKey,
+ kControlKey)).c_str());
}
// Tests if CreateFullXkbLayoutName and ExtractLayoutNameFromFullXkbLayoutName
« no previous file with comments | « chrome/browser/chromeos/input_method/xkeyboard.cc ('k') | chrome/browser/chromeos/preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698