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

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

Issue 306053005: Adds whitelisted non-extension-based input methods if no component extensions are at present (e.g. … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/input_method_util.cc ('k') | chromeos/ime/input_method_whitelist.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/input_method_util_unittest.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc
index 83452a524cd3829d70b82b0a825a5cb4af34d518..97c659a3d71a222f49aa1592ddd7d71395781f85 100644
--- a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc
@@ -39,8 +39,6 @@ class TestableInputMethodUtil : public InputMethodUtil {
// Change access rights.
using InputMethodUtil::GetInputMethodIdsFromLanguageCodeInternal;
using InputMethodUtil::GetKeyboardLayoutName;
- using InputMethodUtil::ReloadInternalMaps;
- using InputMethodUtil::supported_input_methods_;
};
} // namespace
@@ -121,19 +119,7 @@ class InputMethodUtilTest : public testing::Test {
};
TEST_F(InputMethodUtilTest, GetInputMethodShortNameTest) {
- // Test normal cases. Two-letter language code should be returned.
- {
- InputMethodDescriptor desc = GetDesc("vkd_fa", // input method id
- "us", // keyboard layout name
- "fa", // language name
- ""); // indicator
- EXPECT_EQ(ASCIIToUTF16("FA"), util_.GetInputMethodShortName(desc));
- }
- {
- InputMethodDescriptor desc = GetDesc("hangul_2set", "us", "ko", "");
- EXPECT_EQ(base::UTF8ToUTF16("\xed\x95\x9c"),
- util_.GetInputMethodShortName(desc));
- }
+ // Test invalid cases. Two-letter language code should be returned.
{
InputMethodDescriptor desc = GetDesc("invalid-id", "us", "xx", "");
// Upper-case string of the unknown language code, "xx", should be returned.
@@ -305,11 +291,6 @@ TEST_F(InputMethodUtilTest, TestGetKeyboardLayoutName) {
EXPECT_EQ("de(neo)", util_.GetKeyboardLayoutName(Id("xkb:de:neo:ger")));
}
-TEST_F(InputMethodUtilTest, TestGetLanguageCodeFromInputMethodId) {
- // Make sure that the -CN is added properly.
- EXPECT_EQ("zh-CN", util_.GetLanguageCodeFromInputMethodId(Id(pinyin_ime_id)));
-}
-
TEST_F(InputMethodUtilTest, TestGetInputMethodDisplayNameFromId) {
EXPECT_EQ("US",
util_.GetInputMethodDisplayNameFromId("xkb:us::eng"));
@@ -448,9 +429,11 @@ TEST_F(InputMethodUtilTest, TestGetLanguageCodesFromInputMethodIds) {
// Test all supported descriptors to detect a typo in input_methods.txt.
TEST_F(InputMethodUtilTest, TestIBusInputMethodText) {
- for (size_t i = 0; i < util_.supported_input_methods_->size(); ++i) {
- const std::string language_code =
- util_.supported_input_methods_->at(i).language_codes().at(0);
+ const std::map<std::string, InputMethodDescriptor>& id_to_descriptor =
+ util_.GetIdToDesciptorMapForTesting();
+ for (std::map<std::string, InputMethodDescriptor>::const_iterator it =
+ id_to_descriptor.begin(); it != id_to_descriptor.end(); ++it) {
+ const std::string language_code = it->second.language_codes().at(0);
const base::string16 display_name =
l10n_util::GetDisplayNameForLocale(language_code, "en", false);
// Only two formats, like "fr" (lower case) and "en-US" (lower-upper), are
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_util.cc ('k') | chromeos/ime/input_method_whitelist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698