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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 : util_(&delegate_, whitelist_.GetSupportedInputMethods()) { | 44 : util_(&delegate_, whitelist_.GetSupportedInputMethods()) { |
45 } | 45 } |
46 | 46 |
47 InputMethodDescriptor GetDesc(const std::string& id, | 47 InputMethodDescriptor GetDesc(const std::string& id, |
48 const std::string& raw_layout, | 48 const std::string& raw_layout, |
49 const std::string& language_code) { | 49 const std::string& language_code) { |
50 return InputMethodDescriptor(id, | 50 return InputMethodDescriptor(id, |
51 "", | 51 "", |
52 raw_layout, | 52 raw_layout, |
53 language_code, | 53 language_code, |
54 "", // options page url | 54 ""); // options page url |
55 false); | |
56 } | 55 } |
57 | 56 |
58 MockInputMethodDelegate delegate_; | 57 MockInputMethodDelegate delegate_; |
59 InputMethodWhitelist whitelist_; | 58 InputMethodWhitelist whitelist_; |
60 TestableInputMethodUtil util_; | 59 TestableInputMethodUtil util_; |
61 }; | 60 }; |
62 | 61 |
63 TEST_F(InputMethodUtilTest, GetInputMethodShortNameTest) { | 62 TEST_F(InputMethodUtilTest, GetInputMethodShortNameTest) { |
64 // Test normal cases. Two-letter language code should be returned. | 63 // Test normal cases. Two-letter language code should be returned. |
65 { | 64 { |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 EXPECT_FALSE(display_name.empty()) | 504 EXPECT_FALSE(display_name.empty()) |
506 << "Invalid language code " << language_code; | 505 << "Invalid language code " << language_code; |
507 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. | 506 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. |
508 EXPECT_NE(language_code, UTF16ToUTF8(display_name)) | 507 EXPECT_NE(language_code, UTF16ToUTF8(display_name)) |
509 << "Invalid language code " << language_code; | 508 << "Invalid language code " << language_code; |
510 } | 509 } |
511 } | 510 } |
512 | 511 |
513 } // namespace input_method | 512 } // namespace input_method |
514 } // namespace chromeos | 513 } // namespace chromeos |
OLD | NEW |