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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 public: | 41 public: |
42 InputMethodUtilTest() : util_(whitelist_.GetSupportedInputMethods()) { | 42 InputMethodUtilTest() : util_(whitelist_.GetSupportedInputMethods()) { |
43 } | 43 } |
44 | 44 |
45 InputMethodDescriptor GetDesc(const std::string& id, | 45 InputMethodDescriptor GetDesc(const std::string& id, |
46 const std::string& raw_layout, | 46 const std::string& raw_layout, |
47 const std::string& language_code) { | 47 const std::string& language_code) { |
48 return InputMethodDescriptor(id, | 48 return InputMethodDescriptor(id, |
49 "", | 49 "", |
50 raw_layout, | 50 raw_layout, |
51 language_code); | 51 language_code, |
| 52 false); |
52 } | 53 } |
53 | 54 |
54 InputMethodWhitelist whitelist_; | 55 InputMethodWhitelist whitelist_; |
55 TestableInputMethodUtil util_; | 56 TestableInputMethodUtil util_; |
56 }; | 57 }; |
57 | 58 |
58 TEST_F(InputMethodUtilTest, GetInputMethodShortNameTest) { | 59 TEST_F(InputMethodUtilTest, GetInputMethodShortNameTest) { |
59 // Test normal cases. Two-letter language code should be returned. | 60 // Test normal cases. Two-letter language code should be returned. |
60 { | 61 { |
61 InputMethodDescriptor desc = GetDesc("m17n:fa:isiri", // input method id | 62 InputMethodDescriptor desc = GetDesc("m17n:fa:isiri", // input method id |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 EXPECT_FALSE(display_name.empty()) | 521 EXPECT_FALSE(display_name.empty()) |
521 << "Invalid language code " << language_code; | 522 << "Invalid language code " << language_code; |
522 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. | 523 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. |
523 EXPECT_NE(language_code, UTF16ToUTF8(display_name)) | 524 EXPECT_NE(language_code, UTF16ToUTF8(display_name)) |
524 << "Invalid language code " << language_code; | 525 << "Invalid language code " << language_code; |
525 } | 526 } |
526 } | 527 } |
527 | 528 |
528 } // namespace input_method | 529 } // namespace input_method |
529 } // namespace chromeos | 530 } // namespace chromeos |
OLD | NEW |