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

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

Issue 10960060: fix "IME changed" notification uses a wrong field of IME (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: resource ids; more cases Created 8 years, 3 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
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 2b0f8aa8a395d29b4b260ad46f534def81a45dbd..0ed8d652641f31c5e8319c86a8dc5ee9749e523f 100644
--- a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc
@@ -112,11 +112,6 @@ TEST_F(InputMethodUtilTest, GetInputMethodShortNameTest) {
util_.GetInputMethodShortName(desc));
}
{
- InputMethodDescriptor desc = GetDesc("zinnia-japanese", "us", "ja");
- EXPECT_EQ(UTF8ToUTF16("\xe6\x89\x8b"),
- util_.GetInputMethodShortName(desc));
- }
- {
InputMethodDescriptor desc = GetDesc("pinyin", "us", "zh-CN");
EXPECT_EQ(UTF8ToUTF16("\xe6\x8b\xbc"),
util_.GetInputMethodShortName(desc));
@@ -143,6 +138,50 @@ TEST_F(InputMethodUtilTest, GetInputMethodShortNameTest) {
}
}
+TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) {
+ {
+ // input methods with medium name equal to short name
+ const char * input_method_id[] = {
+ "xkb:us:altgr-intl:eng",
+ "xkb:us:dvorak:eng",
+ "xkb:us:intl:eng",
+ "xkb:us:colemak:eng",
+ "english-m",
+ "xkb:de:neo:ger",
+ "xkb:es:cat:cat",
+ "xkb:gb:dvorak:eng",
+ };
+ const int len = ARRAYSIZE_UNSAFE(input_method_id);
+ for (int i=0; i<len; ++i) {
+ InputMethodDescriptor desc = GetDesc(input_method_id[i], "", "");
+ string16 medium_name = util_.GetInputMethodMediumName(desc);
+ string16 short_name = util_.GetInputMethodShortName(desc);
+ EXPECT_EQ(medium_name,short_name);
+ }
+ }
+ {
+ // input methods with medium name not equal to short name
+ const char * input_method_id[] = {
+ "m17n:zh:cangjie",
+ "m17n:zh:quick",
+ "mozc",
+ "mozc-chewing",
+ "mozc-dv",
+ "mozc-hangul",
+ "mozc-jp",
+ "pinyin",
+ "pinyin-dv",
+ };
+ const int len = ARRAYSIZE_UNSAFE(input_method_id);
+ for (int i=0; i<len; ++i) {
+ InputMethodDescriptor desc = GetDesc(input_method_id[i], "", "");
+ string16 medium_name = util_.GetInputMethodMediumName(desc);
+ string16 short_name = util_.GetInputMethodShortName(desc);
+ EXPECT_NE(medium_name,short_name);
+ }
+ }
+}
+
TEST_F(InputMethodUtilTest, GetInputMethodLongNameTest) {
// For most languages input method or keyboard layout name is returned.
// See below for exceptions.
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_util.cc ('k') | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698