| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 "us", "us", "eng"))); | 97 "us", "us", "eng"))); |
| 98 } | 98 } |
| 99 | 99 |
| 100 TEST_F(InputMethodUtilTest, GetKeyboardLayoutName) { | 100 TEST_F(InputMethodUtilTest, GetKeyboardLayoutName) { |
| 101 // Unsupported case. | 101 // Unsupported case. |
| 102 EXPECT_EQ("", GetKeyboardLayoutName("UNSUPPORTED_ID")); | 102 EXPECT_EQ("", GetKeyboardLayoutName("UNSUPPORTED_ID")); |
| 103 | 103 |
| 104 // Supported cases (samples). | 104 // Supported cases (samples). |
| 105 EXPECT_EQ("jp", GetKeyboardLayoutName("mozc-jp")); | 105 EXPECT_EQ("jp", GetKeyboardLayoutName("mozc-jp")); |
| 106 EXPECT_EQ("us", GetKeyboardLayoutName("pinyin")); | 106 EXPECT_EQ("us", GetKeyboardLayoutName("pinyin")); |
| 107 EXPECT_EQ("us(dvorak)", GetKeyboardLayoutName("pinyin-dv")); |
| 107 EXPECT_EQ("us", GetKeyboardLayoutName("m17n:ar:kbd")); | 108 EXPECT_EQ("us", GetKeyboardLayoutName("m17n:ar:kbd")); |
| 108 EXPECT_EQ("es", GetKeyboardLayoutName("xkb:es::spa")); | 109 EXPECT_EQ("es", GetKeyboardLayoutName("xkb:es::spa")); |
| 109 EXPECT_EQ("es(cat)", GetKeyboardLayoutName("xkb:es:cat:cat")); | 110 EXPECT_EQ("es(cat)", GetKeyboardLayoutName("xkb:es:cat:cat")); |
| 110 EXPECT_EQ("gb(extd)", GetKeyboardLayoutName("xkb:gb:extd:eng")); | 111 EXPECT_EQ("gb(extd)", GetKeyboardLayoutName("xkb:gb:extd:eng")); |
| 111 EXPECT_EQ("us", GetKeyboardLayoutName("xkb:us::eng")); | 112 EXPECT_EQ("us", GetKeyboardLayoutName("xkb:us::eng")); |
| 112 EXPECT_EQ("us(dvorak)", GetKeyboardLayoutName("xkb:us:dvorak:eng")); | 113 EXPECT_EQ("us(dvorak)", GetKeyboardLayoutName("xkb:us:dvorak:eng")); |
| 113 EXPECT_EQ("us(colemak)", GetKeyboardLayoutName("xkb:us:colemak:eng")); | 114 EXPECT_EQ("us(colemak)", GetKeyboardLayoutName("xkb:us:colemak:eng")); |
| 114 EXPECT_EQ("de(neo)", GetKeyboardLayoutName("xkb:de:neo:ger")); | 115 EXPECT_EQ("de(neo)", GetKeyboardLayoutName("xkb:de:neo:ger")); |
| 115 } | 116 } |
| 116 | 117 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 std::vector<std::string> language_codes; | 306 std::vector<std::string> language_codes; |
| 306 GetLanguageCodesFromInputMethodIds(input_method_ids, &language_codes); | 307 GetLanguageCodesFromInputMethodIds(input_method_ids, &language_codes); |
| 307 ASSERT_EQ(3U, language_codes.size()); | 308 ASSERT_EQ(3U, language_codes.size()); |
| 308 EXPECT_EQ("en-US", language_codes[0]); | 309 EXPECT_EQ("en-US", language_codes[0]); |
| 309 EXPECT_EQ("ja", language_codes[1]); | 310 EXPECT_EQ("ja", language_codes[1]); |
| 310 EXPECT_EQ("fr", language_codes[2]); | 311 EXPECT_EQ("fr", language_codes[2]); |
| 311 } | 312 } |
| 312 | 313 |
| 313 } // namespace input_method | 314 } // namespace input_method |
| 314 } // namespace chromeos | 315 } // namespace chromeos |
| OLD | NEW |