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 GetDesc("xkb:de:neo:ger", "de(neo)", "de", "NEO"); | 152 GetDesc("xkb:de:neo:ger", "de(neo)", "de", "NEO"); |
153 EXPECT_EQ(ASCIIToUTF16("NEO"), util_.GetInputMethodShortName(desc)); | 153 EXPECT_EQ(ASCIIToUTF16("NEO"), util_.GetInputMethodShortName(desc)); |
154 } | 154 } |
155 { | 155 { |
156 InputMethodDescriptor desc = | 156 InputMethodDescriptor desc = |
157 GetDesc("xkb:es:cat:cat", "es(cat)", "ca", "CAS"); | 157 GetDesc("xkb:es:cat:cat", "es(cat)", "ca", "CAS"); |
158 EXPECT_EQ(ASCIIToUTF16("CAS"), util_.GetInputMethodShortName(desc)); | 158 EXPECT_EQ(ASCIIToUTF16("CAS"), util_.GetInputMethodShortName(desc)); |
159 } | 159 } |
160 { | 160 { |
161 InputMethodDescriptor desc = | 161 InputMethodDescriptor desc = |
162 GetDesc(pinyin_ime_id, "us", "zh-CN", ""); | 162 GetDesc(pinyin_ime_id, "us", "zh-CN", "\xe6\x8b\xbc"); |
163 EXPECT_EQ(base::UTF8ToUTF16("\xe6\x8b\xbc"), | 163 EXPECT_EQ(base::UTF8ToUTF16("\xe6\x8b\xbc"), |
164 util_.GetInputMethodShortName(desc)); | 164 util_.GetInputMethodShortName(desc)); |
165 } | 165 } |
166 { | 166 { |
167 InputMethodDescriptor desc = GetDesc(zhuyin_ime_id, "us", "zh-TW", ""); | 167 InputMethodDescriptor desc = |
| 168 GetDesc(zhuyin_ime_id, "us", "zh-TW", "\xE6\xB3\xA8"); |
168 EXPECT_EQ(base::UTF8ToUTF16("\xE6\xB3\xA8"), | 169 EXPECT_EQ(base::UTF8ToUTF16("\xE6\xB3\xA8"), |
169 util_.GetInputMethodShortName(desc)); | 170 util_.GetInputMethodShortName(desc)); |
170 } | 171 } |
171 } | 172 } |
172 | 173 |
173 TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) { | 174 TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) { |
174 { | 175 { |
175 // input methods with medium name equal to short name | 176 // input methods with medium name equal to short name |
176 const char * input_method_id[] = { | 177 const char * input_method_id[] = { |
177 "xkb:us:altgr-intl:eng", | 178 "xkb:us:altgr-intl:eng", |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 EXPECT_EQ(arraysize(migration_cases), input_method_ids.size()); | 476 EXPECT_EQ(arraysize(migration_cases), input_method_ids.size()); |
476 for (size_t i = 0; i < arraysize(migration_cases); ++i) { | 477 for (size_t i = 0; i < arraysize(migration_cases); ++i) { |
477 EXPECT_EQ( | 478 EXPECT_EQ( |
478 extension_ime_util::GetInputMethodIDByEngineID(migration_cases[i][1]), | 479 extension_ime_util::GetInputMethodIDByEngineID(migration_cases[i][1]), |
479 input_method_ids[i]); | 480 input_method_ids[i]); |
480 } | 481 } |
481 } | 482 } |
482 | 483 |
483 } // namespace input_method | 484 } // namespace input_method |
484 } // namespace chromeos | 485 } // namespace chromeos |
OLD | NEW |