| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 InputMethodDescriptor desc = GetDesc("xkb:es:cat:cat", "es(cat)", "ca"); | 152 InputMethodDescriptor desc = GetDesc("xkb:es:cat:cat", "es(cat)", "ca"); |
| 153 EXPECT_EQ(ASCIIToUTF16("CAS"), util_.GetInputMethodShortName(desc)); | 153 EXPECT_EQ(ASCIIToUTF16("CAS"), util_.GetInputMethodShortName(desc)); |
| 154 } | 154 } |
| 155 { | 155 { |
| 156 InputMethodDescriptor desc = GetDesc(pinyin_ime_id, "us", "zh-CN"); | 156 InputMethodDescriptor desc = GetDesc(pinyin_ime_id, "us", "zh-CN"); |
| 157 EXPECT_EQ(UTF8ToUTF16("\xe6\x8b\xbc"), | 157 EXPECT_EQ(UTF8ToUTF16("\xe6\x8b\xbc"), |
| 158 util_.GetInputMethodShortName(desc)); | 158 util_.GetInputMethodShortName(desc)); |
| 159 } | 159 } |
| 160 { | 160 { |
| 161 InputMethodDescriptor desc = GetDesc(zhuyin_ime_id, "us", "zh-TW"); | 161 InputMethodDescriptor desc = GetDesc(zhuyin_ime_id, "us", "zh-TW"); |
| 162 EXPECT_EQ(UTF8ToUTF16("\xe9\x85\xb7"), | 162 EXPECT_EQ(UTF8ToUTF16("\xE6\xB3\xA8"), |
| 163 util_.GetInputMethodShortName(desc)); | |
| 164 } | |
| 165 { | |
| 166 InputMethodDescriptor desc = GetDesc("m17n:zh:cangjie", "us", "zh-TW"); | |
| 167 EXPECT_EQ(UTF8ToUTF16("\xe5\x80\x89"), | |
| 168 util_.GetInputMethodShortName(desc)); | |
| 169 } | |
| 170 { | |
| 171 InputMethodDescriptor desc = GetDesc("m17n:zh:quick", "us", "zh-TW"); | |
| 172 EXPECT_EQ(UTF8ToUTF16("\xe9\x80\x9f"), | |
| 173 util_.GetInputMethodShortName(desc)); | 163 util_.GetInputMethodShortName(desc)); |
| 174 } | 164 } |
| 175 } | 165 } |
| 176 | 166 |
| 177 TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) { | 167 TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) { |
| 178 { | 168 { |
| 179 // input methods with medium name equal to short name | 169 // input methods with medium name equal to short name |
| 180 const char * input_method_id[] = { | 170 const char * input_method_id[] = { |
| 181 "xkb:us:altgr-intl:eng", | 171 "xkb:us:altgr-intl:eng", |
| 182 "xkb:us:dvorak:eng", | 172 "xkb:us:dvorak:eng", |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 EXPECT_FALSE(display_name.empty()) | 475 EXPECT_FALSE(display_name.empty()) |
| 486 << "Invalid language code " << language_code; | 476 << "Invalid language code " << language_code; |
| 487 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. | 477 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. |
| 488 EXPECT_NE(language_code, UTF16ToUTF8(display_name)) | 478 EXPECT_NE(language_code, UTF16ToUTF8(display_name)) |
| 489 << "Invalid language code " << language_code; | 479 << "Invalid language code " << language_code; |
| 490 } | 480 } |
| 491 } | 481 } |
| 492 | 482 |
| 493 } // namespace input_method | 483 } // namespace input_method |
| 494 } // namespace chromeos | 484 } // namespace chromeos |
| OLD | NEW |