| 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/ui/webui/options/chromeos/cros_language_options_handler
.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler
.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include <memory> |
| 8 |
| 8 #include "base/values.h" | 9 #include "base/values.h" |
| 9 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
| 10 #include "chrome/browser/ui/webui/chromeos/login/l10n_util_test_util.h" | 11 #include "chrome/browser/ui/webui/chromeos/login/l10n_util_test_util.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 13 |
| 13 namespace chromeos { | 14 namespace chromeos { |
| 14 namespace options { | 15 namespace options { |
| 15 | 16 |
| 16 class CrosLanguageOptionsHandlerTest : public testing::Test { | 17 class CrosLanguageOptionsHandlerTest : public testing::Test { |
| 17 public: | 18 public: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 30 input_manager_->AddInputMethod("xkb:fr::fra", "fr", "fr"); | 31 input_manager_->AddInputMethod("xkb:fr::fra", "fr", "fr"); |
| 31 input_manager_->AddInputMethod("xkb:be::fra", "be", "fr"); | 32 input_manager_->AddInputMethod("xkb:be::fra", "be", "fr"); |
| 32 input_manager_->AddInputMethod("xkb:is::ice", "is", "is"); | 33 input_manager_->AddInputMethod("xkb:is::ice", "is", "is"); |
| 33 } | 34 } |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 MockInputMethodManagerWithInputMethods* input_manager_; | 37 MockInputMethodManagerWithInputMethods* input_manager_; |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 TEST_F(CrosLanguageOptionsHandlerTest, GetInputMethodList) { | 40 TEST_F(CrosLanguageOptionsHandlerTest, GetInputMethodList) { |
| 40 scoped_ptr<base::ListValue> list( | 41 std::unique_ptr<base::ListValue> list( |
| 41 CrosLanguageOptionsHandler::GetInputMethodList()); | 42 CrosLanguageOptionsHandler::GetInputMethodList()); |
| 42 ASSERT_EQ(4U, list->GetSize()); | 43 ASSERT_EQ(4U, list->GetSize()); |
| 43 | 44 |
| 44 base::DictionaryValue* entry = NULL; | 45 base::DictionaryValue* entry = NULL; |
| 45 base::DictionaryValue *language_code_set = NULL; | 46 base::DictionaryValue *language_code_set = NULL; |
| 46 std::string input_method_id; | 47 std::string input_method_id; |
| 47 std::string display_name; | 48 std::string display_name; |
| 48 std::string language_code; | 49 std::string language_code; |
| 49 | 50 |
| 50 // As shown below, the list should be input method ids should appear in | 51 // As shown below, the list should be input method ids should appear in |
| 51 // the same order of the descriptors. | 52 // the same order of the descriptors. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 82 ASSERT_TRUE(entry->GetString("displayName", &display_name)); | 83 ASSERT_TRUE(entry->GetString("displayName", &display_name)); |
| 83 ASSERT_TRUE(entry->GetDictionary("languageCodeSet", &language_code_set)); | 84 ASSERT_TRUE(entry->GetDictionary("languageCodeSet", &language_code_set)); |
| 84 EXPECT_EQ("xkb:is::ice", input_method_id); | 85 EXPECT_EQ("xkb:is::ice", input_method_id); |
| 85 // Commented out. See above. | 86 // Commented out. See above. |
| 86 // EXPECT_EQ("Japanese input method (for US keyboard)", display_name); | 87 // EXPECT_EQ("Japanese input method (for US keyboard)", display_name); |
| 87 ASSERT_TRUE(language_code_set->HasKey("is")); | 88 ASSERT_TRUE(language_code_set->HasKey("is")); |
| 88 } | 89 } |
| 89 | 90 |
| 90 } // namespace options | 91 } // namespace options |
| 91 } // namespace chromeos | 92 } // namespace chromeos |
| OLD | NEW |