Index: chromeos_keyboard_unittest.cc |
diff --git a/chromeos_keyboard_unittest.cc b/chromeos_keyboard_unittest.cc |
index d37f60afe0a44d18e258f69d00fedccf6d2890b3..ee257814ebd2ff83d4f5d247f6dd119177ec9886 100644 |
--- a/chromeos_keyboard_unittest.cc |
+++ b/chromeos_keyboard_unittest.cc |
@@ -182,94 +182,6 @@ TEST(ChromeOSKeyboardTest, TestCreateFullXkbLayoutNameModifierKeys) { |
<< "layout: " << layout; |
// All 4*3*3 layouts should be different. |
EXPECT_TRUE(layouts.insert(layout).second) << "layout: " << layout; |
- // Round-trip conversion should be possible. |
- EXPECT_STREQ( |
- "us", ExtractLayoutNameFromFullXkbLayoutName(layout).c_str()) |
- << "layout: " << layout; |
- } |
- } |
- } |
-} |
- |
-// Tests ExtractLayoutNameFromFullXkbLayoutName() function. |
-TEST(ChromeOSKeyboardTest, TestExtractLayoutNameFromFullXkbLayoutName) { |
- EXPECT_STREQ("us", ExtractLayoutNameFromFullXkbLayoutName( |
- "us+chromeos(foo)").c_str()); |
- EXPECT_STREQ("us(dvorak)", ExtractLayoutNameFromFullXkbLayoutName( |
- "us(dvorak)+chromeos(foo)").c_str()); |
- EXPECT_STREQ("", ExtractLayoutNameFromFullXkbLayoutName("").c_str()); |
- // ExtractLayoutNameFromFullXkbLayoutName should not accept layout without +. |
- EXPECT_STREQ("", ExtractLayoutNameFromFullXkbLayoutName("us").c_str()); |
-} |
- |
-// Tests ExtractModifierMapFromFullXkbLayoutName() function. |
-TEST(ChromeOSKeyboardTest, TestExtractModifierMapFromFullXkbLayoutName) { |
- StringToModifierMap string_to_modifier_map; |
- InitializeStringToModifierMap(&string_to_modifier_map); |
- |
- ModifierMap modifier_map; |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "", string_to_modifier_map, &modifier_map)); |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "us", string_to_modifier_map, &modifier_map)); |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)", string_to_modifier_map, &modifier_map)); |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+", string_to_modifier_map, &modifier_map)); |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+chromeos(", string_to_modifier_map, &modifier_map)); |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+chromeos()", string_to_modifier_map, &modifier_map)); |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+chromeos(f", string_to_modifier_map, &modifier_map)); |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+chromeos(foo", string_to_modifier_map, &modifier_map)); |
- EXPECT_FALSE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+chromeos(foo)", string_to_modifier_map, &modifier_map)); |
- |
- EXPECT_TRUE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+chromeos(disabled_disabled_disabled)", |
- string_to_modifier_map, &modifier_map)); |
- EXPECT_EQ(3, modifier_map.size()); |
- EXPECT_TRUE(CheckMap(modifier_map, kVoidKey, kVoidKey, kVoidKey)); |
- |
- EXPECT_TRUE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+chromeos(disabled_disabled_disabled)+", |
- string_to_modifier_map, &modifier_map)); |
- EXPECT_EQ(3, modifier_map.size()); |
- EXPECT_TRUE(CheckMap(modifier_map, kVoidKey, kVoidKey, kVoidKey)); |
- |
- EXPECT_TRUE(ExtractModifierMapFromFullXkbLayoutName( |
- "us(dvorak)+chromeos(disabled_disabled_disabled)+inet(pc105)", |
- string_to_modifier_map, &modifier_map)); |
- EXPECT_EQ(3, modifier_map.size()); |
- EXPECT_TRUE(CheckMap(modifier_map, kVoidKey, kVoidKey, kVoidKey)); |
- |
- EXPECT_TRUE(ExtractModifierMapFromFullXkbLayoutName( |
- "+chromeos(disabled_disabled_disabled)", |
- string_to_modifier_map, &modifier_map)); |
- EXPECT_EQ(3, modifier_map.size()); |
- EXPECT_TRUE(CheckMap(modifier_map, kVoidKey, kVoidKey, kVoidKey)); |
- |
- EXPECT_TRUE(ExtractModifierMapFromFullXkbLayoutName( |
- "+chromeos(disabled_disabled_disabled)+inet(pc105)", |
- string_to_modifier_map, &modifier_map)); |
- EXPECT_EQ(3, modifier_map.size()); |
- EXPECT_TRUE(CheckMap(modifier_map, kVoidKey, kVoidKey, kVoidKey)); |
- |
- // Check all cases just in case. |
- for (int i = 0; i < static_cast<int>(kNumModifierKeys); ++i) { |
- for (int j = 0; j < static_cast<int>(kNumModifierKeys); ++j) { |
- for (int k = 0; k < static_cast<int>(kNumModifierKeys); ++k) { |
- const std::string layout = CreateFullXkbLayoutName( |
- "us", GetMap(ModifierKey(i), ModifierKey(j), ModifierKey(k)), true); |
- EXPECT_TRUE(ExtractModifierMapFromFullXkbLayoutName( |
- layout, string_to_modifier_map, &modifier_map)) |
- << "layout: " << layout; |
- EXPECT_EQ(3, modifier_map.size()) << "layout: " << layout; |
- EXPECT_TRUE(CheckMap( |
- modifier_map, ModifierKey(i), ModifierKey(j), ModifierKey(k))) |
- << "layout: " << layout; |
} |
} |
} |