Chromium Code Reviews| 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/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/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 const std::string& raw_layout, | 43 const std::string& raw_layout, |
| 44 const std::string& language_code) { | 44 const std::string& language_code) { |
| 45 std::vector<std::string> layouts; | 45 std::vector<std::string> layouts; |
| 46 layouts.push_back(raw_layout); | 46 layouts.push_back(raw_layout); |
| 47 std::vector<std::string> languages; | 47 std::vector<std::string> languages; |
| 48 languages.push_back(language_code); | 48 languages.push_back(language_code); |
| 49 return InputMethodDescriptor(id, | 49 return InputMethodDescriptor(id, |
| 50 "", // name | 50 "", // name |
| 51 layouts, | 51 layouts, |
| 52 languages, | 52 languages, |
| 53 true, | |
|
Nikita (slow)
2013/08/22 14:39:57
nit: Please add comment for boolean value.
Seigo Nonaka
2013/08/24 07:57:02
Done.
| |
| 53 GURL()); // options page url | 54 GURL()); // options page url |
| 54 } | 55 } |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace | 58 } // namespace |
| 58 | 59 |
| 59 TEST_F(CrosLanguageOptionsHandlerTest, GetInputMethodList) { | 60 TEST_F(CrosLanguageOptionsHandlerTest, GetInputMethodList) { |
| 60 InputMethodDescriptors descriptors = CreateInputMethodDescriptors(); | 61 InputMethodDescriptors descriptors = CreateInputMethodDescriptors(); |
| 61 scoped_ptr<ListValue> list( | 62 scoped_ptr<ListValue> list( |
| 62 chromeos::options::CrosLanguageOptionsHandler::GetInputMethodList( | 63 chromeos::options::CrosLanguageOptionsHandler::GetInputMethodList( |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 for (size_t i = 0; i < list->GetSize(); ++i) { | 119 for (size_t i = 0; i < list->GetSize(); ++i) { |
| 119 base::DictionaryValue* dict; | 120 base::DictionaryValue* dict; |
| 120 ASSERT_TRUE(list->GetDictionary(i, &dict)); | 121 ASSERT_TRUE(list->GetDictionary(i, &dict)); |
| 121 std::string code; | 122 std::string code; |
| 122 ASSERT_TRUE(dict->GetString("code", &code)); | 123 ASSERT_TRUE(dict->GetString("code", &code)); |
| 123 EXPECT_NE("is", code) | 124 EXPECT_NE("is", code) |
| 124 << "Icelandic is an example language which has input method " | 125 << "Icelandic is an example language which has input method " |
| 125 << "but can't use it as UI language."; | 126 << "but can't use it as UI language."; |
| 126 } | 127 } |
| 127 } | 128 } |
| OLD | NEW |