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

Unified Diff: chromeos_keyboard_unittest.cc

Issue 6730052: Use chromeos::Process in libchromeos.a instead of g_spawn_async. (Closed) Base URL: http://git.chromium.org/git/cros.git@0.11.257.B
Patch Set: Created 9 years, 9 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 | « chromeos_keyboard.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
}
« no previous file with comments | « chromeos_keyboard.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698