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

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

Issue 10456055: Stop using "+chromeos(...)" in an XKB layout name. (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') | no next file » | 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 55e687fab46a49420ff1879a75b2e614eb30765a..0b2cd5dc183176942b49b3fb37da4e53c6920927 100644
--- a/chrome/browser/chromeos/input_method/xkeyboard_unittest.cc
+++ b/chrome/browser/chromeos/input_method/xkeyboard_unittest.cc
@@ -56,33 +56,30 @@ bool DisplayAvailable() {
} // namespace
-// Tests CreateFullXkbLayoutName() function.
-TEST_F(XKeyboardTest, TestCreateFullXkbLayoutNameBasic) {
- // CreateFullXkbLayoutName should not accept non-alphanumeric characters
+// Tests CheckLayoutName() function.
+TEST_F(XKeyboardTest, TestCheckLayoutName) {
+ // CheckLayoutName should not accept non-alphanumeric characters
// except "()-_".
- EXPECT_EQ("", xkey_->CreateFullXkbLayoutName("us!"));
- EXPECT_EQ("", xkey_->CreateFullXkbLayoutName("us; /bin/sh"));
- EXPECT_EQ("ab-c_12+chromeos(search_leftcontrol_leftalt_keepralt)",
- xkey_->CreateFullXkbLayoutName("ab-c_12"));
+ EXPECT_FALSE(XKeyboard::CheckLayoutNameForTesting("us!"));
+ EXPECT_FALSE(XKeyboard::CheckLayoutNameForTesting("us; /bin/sh"));
+ EXPECT_TRUE(XKeyboard::CheckLayoutNameForTesting("ab-c_12"));
- // CreateFullXkbLayoutName should not accept upper-case ascii characters.
- EXPECT_EQ("", xkey_->CreateFullXkbLayoutName("US"));
+ // CheckLayoutName should not accept upper-case ascii characters.
+ EXPECT_FALSE(XKeyboard::CheckLayoutNameForTesting("US"));
- // CreateFullXkbLayoutName should accept lower-case ascii characters.
+ // CheckLayoutName should accept lower-case ascii characters.
for (int c = 'a'; c <= 'z'; ++c) {
- EXPECT_NE("", xkey_->CreateFullXkbLayoutName(std::string(3, c)));
+ EXPECT_TRUE(XKeyboard::CheckLayoutNameForTesting(std::string(3, c)));
}
- // CreateFullXkbLayoutName should accept numbers.
+ // CheckLayoutName should accept numbers.
for (int c = '0'; c <= '9'; ++c) {
- EXPECT_NE("", xkey_->CreateFullXkbLayoutName(std::string(3, c)));
+ EXPECT_TRUE(XKeyboard::CheckLayoutNameForTesting(std::string(3, c)));
}
- // CreateFullXkbLayoutName should accept a layout with a variant name.
- EXPECT_EQ("us(dvorak)+chromeos(search_leftcontrol_leftalt_keepralt)",
- xkey_->CreateFullXkbLayoutName("us(dvorak)"));
- EXPECT_EQ("jp+chromeos(search_leftcontrol_leftalt_keepralt)",
- xkey_->CreateFullXkbLayoutName("jp"));
+ // CheckLayoutName should accept a layout with a variant name.
+ EXPECT_TRUE(XKeyboard::CheckLayoutNameForTesting("us(dvorak)"));
+ EXPECT_TRUE(XKeyboard::CheckLayoutNameForTesting("jp"));
}
TEST_F(XKeyboardTest, TestSetCapsLockEnabled) {
« no previous file with comments | « chrome/browser/chromeos/input_method/xkeyboard.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698