OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/status/input_method_menu.h" | 5 #include "chrome/browser/chromeos/status/input_method_menu.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
(...skipping 17 matching lines...) Expand all Loading... |
28 // Upper-case string of the unknown language code, "xx", should be returned. | 28 // Upper-case string of the unknown language code, "xx", should be returned. |
29 EXPECT_EQ(L"XX", InputMethodMenu::GetTextForIndicator(desc)); | 29 EXPECT_EQ(L"XX", InputMethodMenu::GetTextForIndicator(desc)); |
30 } | 30 } |
31 | 31 |
32 // Test special cases. | 32 // Test special cases. |
33 { | 33 { |
34 InputMethodDescriptor desc("xkb:us:dvorak:eng", "Dvorak", "us", "eng"); | 34 InputMethodDescriptor desc("xkb:us:dvorak:eng", "Dvorak", "us", "eng"); |
35 EXPECT_EQ(L"DV", InputMethodMenu::GetTextForIndicator(desc)); | 35 EXPECT_EQ(L"DV", InputMethodMenu::GetTextForIndicator(desc)); |
36 } | 36 } |
37 { | 37 { |
| 38 InputMethodDescriptor desc("xkb:us:colemak:eng", "Colemak", "us", "eng"); |
| 39 EXPECT_EQ(L"CO", InputMethodMenu::GetTextForIndicator(desc)); |
| 40 } |
| 41 { |
38 InputMethodDescriptor desc("xkb:us:altgr-intl:eng", "US extd", "us", "eng"); | 42 InputMethodDescriptor desc("xkb:us:altgr-intl:eng", "US extd", "us", "eng"); |
39 EXPECT_EQ(L"EXTD", InputMethodMenu::GetTextForIndicator(desc)); | 43 EXPECT_EQ(L"EXTD", InputMethodMenu::GetTextForIndicator(desc)); |
40 } | 44 } |
41 { | 45 { |
42 InputMethodDescriptor desc("xkb:us:intl:eng", "US intl", "us", "eng"); | 46 InputMethodDescriptor desc("xkb:us:intl:eng", "US intl", "us", "eng"); |
43 EXPECT_EQ(L"INTL", InputMethodMenu::GetTextForIndicator(desc)); | 47 EXPECT_EQ(L"INTL", InputMethodMenu::GetTextForIndicator(desc)); |
44 } | 48 } |
45 { | 49 { |
46 InputMethodDescriptor desc("mozc", "Mozc", "us", "ja"); | 50 InputMethodDescriptor desc("mozc", "Mozc", "us", "ja"); |
47 EXPECT_EQ(UTF8ToWide("\xe3\x81\x82"), | 51 EXPECT_EQ(UTF8ToWide("\xe3\x81\x82"), |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 { | 161 { |
158 InputMethodDescriptor desc("invalid-id", "unregistered string", "us", "xx"); | 162 InputMethodDescriptor desc("invalid-id", "unregistered string", "us", "xx"); |
159 // You can safely ignore the "Resouce ID is not found for: unregistered | 163 // You can safely ignore the "Resouce ID is not found for: unregistered |
160 // string" error. | 164 // string" error. |
161 EXPECT_EQ(L"unregistered string", | 165 EXPECT_EQ(L"unregistered string", |
162 InputMethodMenu::GetTextForMenu(desc)); | 166 InputMethodMenu::GetTextForMenu(desc)); |
163 } | 167 } |
164 } | 168 } |
165 | 169 |
166 } // namespace chromeos | 170 } // namespace chromeos |
OLD | NEW |