| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 const char pinyin_ime_id[] = "zh-t-i0-pinyin"; | 30 const char pinyin_ime_id[] = "zh-t-i0-pinyin"; |
| 31 const char zhuyin_ime_id[] = "zh-hant-t-i0-und"; | 31 const char zhuyin_ime_id[] = "zh-hant-t-i0-und"; |
| 32 | 32 |
| 33 class TestableInputMethodUtil : public InputMethodUtil { | 33 class TestableInputMethodUtil : public InputMethodUtil { |
| 34 public: | 34 public: |
| 35 explicit TestableInputMethodUtil(InputMethodDelegate* delegate, | 35 explicit TestableInputMethodUtil(InputMethodDelegate* delegate, |
| 36 scoped_ptr<InputMethodDescriptors> methods) | 36 scoped_ptr<InputMethodDescriptors> methods) |
| 37 : InputMethodUtil(delegate, methods.Pass()) { | 37 : InputMethodUtil(delegate) { |
| 38 ResetInputMethods(*methods); |
| 38 } | 39 } |
| 39 // Change access rights. | 40 // Change access rights. |
| 40 using InputMethodUtil::GetInputMethodIdsFromLanguageCodeInternal; | 41 using InputMethodUtil::GetInputMethodIdsFromLanguageCodeInternal; |
| 41 using InputMethodUtil::GetKeyboardLayoutName; | 42 using InputMethodUtil::GetKeyboardLayoutName; |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 } // namespace | 45 } // namespace |
| 45 | 46 |
| 46 class InputMethodUtilTest : public testing::Test { | 47 class InputMethodUtilTest : public testing::Test { |
| 47 public: | 48 public: |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 EXPECT_FALSE(display_name.empty()) | 447 EXPECT_FALSE(display_name.empty()) |
| 447 << "Invalid language code " << language_code; | 448 << "Invalid language code " << language_code; |
| 448 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. | 449 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. |
| 449 EXPECT_NE(language_code, base::UTF16ToUTF8(display_name)) | 450 EXPECT_NE(language_code, base::UTF16ToUTF8(display_name)) |
| 450 << "Invalid language code " << language_code; | 451 << "Invalid language code " << language_code; |
| 451 } | 452 } |
| 452 } | 453 } |
| 453 | 454 |
| 454 } // namespace input_method | 455 } // namespace input_method |
| 455 } // namespace chromeos | 456 } // namespace chromeos |
| OLD | NEW |