| 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/ui/webui/options/language_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/language_options_handler.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/values.h" | 10 #include "base/values.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 EXPECT_EQ("mozc", input_method_id); | 87 EXPECT_EQ("mozc", input_method_id); |
| 88 // Commented out. See above. | 88 // Commented out. See above. |
| 89 // EXPECT_EQ("Japanese input method (for US keyboard)", display_name); | 89 // EXPECT_EQ("Japanese input method (for US keyboard)", display_name); |
| 90 ASSERT_TRUE(language_code_set->HasKey("ja")); | 90 ASSERT_TRUE(language_code_set->HasKey("ja")); |
| 91 } | 91 } |
| 92 | 92 |
| 93 TEST(LanguageOptionsHandlerTest, GetLanguageList) { | 93 TEST(LanguageOptionsHandlerTest, GetLanguageList) { |
| 94 InputMethodDescriptors descriptors = CreateInputMethodDescriptors(); | 94 InputMethodDescriptors descriptors = CreateInputMethodDescriptors(); |
| 95 scoped_ptr<ListValue> list( | 95 scoped_ptr<ListValue> list( |
| 96 chromeos::CrosLanguageOptionsHandler::GetLanguageList(descriptors)); | 96 chromeos::CrosLanguageOptionsHandler::GetLanguageList(descriptors)); |
| 97 ASSERT_EQ(8U, list->GetSize()); | 97 ASSERT_EQ(13U, list->GetSize()); |
| 98 | 98 |
| 99 DictionaryValue* entry = NULL; | 99 DictionaryValue* entry = NULL; |
| 100 std::string language_code; | 100 std::string language_code; |
| 101 std::string display_name; | 101 std::string display_name; |
| 102 std::string native_display_name; | 102 std::string native_display_name; |
| 103 | 103 |
| 104 // As shown below, the list should be sorted by the display names, | 104 // As shown below, the list should be sorted by the display names, |
| 105 // and these names should not have duplicates. | 105 // and these names should not have duplicates. |
| 106 | 106 |
| 107 // This comes from kExtraLanguages. | 107 // This comes from kExtraLanguages. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // fail when we add support for the language. | 184 // fail when we add support for the language. |
| 185 // EXPECT_FALSE(dictionary->HasKey("no")); | 185 // EXPECT_FALSE(dictionary->HasKey("no")); |
| 186 } | 186 } |
| 187 #endif // !defined(OS_MACOSX) | 187 #endif // !defined(OS_MACOSX) |
| 188 | 188 |
| 189 TEST(LanguageOptionsHandlerTest, GetSpellCheckLanguageCodeSet) { | 189 TEST(LanguageOptionsHandlerTest, GetSpellCheckLanguageCodeSet) { |
| 190 scoped_ptr<DictionaryValue> dictionary( | 190 scoped_ptr<DictionaryValue> dictionary( |
| 191 LanguageOptionsHandler::GetSpellCheckLanguageCodeSet()); | 191 LanguageOptionsHandler::GetSpellCheckLanguageCodeSet()); |
| 192 EXPECT_TRUE(dictionary->HasKey("en-US")); | 192 EXPECT_TRUE(dictionary->HasKey("en-US")); |
| 193 } | 193 } |
| OLD | NEW |