diff options
author | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-21 09:00:42 +0000 |
---|---|---|
committer | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-21 09:00:42 +0000 |
commit | 0db3982e5f9d9f8ff43262fb00e0001ebf8c7897 (patch) | |
tree | 4e8625f24337ce345231a0d6ef58b044fcaecb92 /chrome/browser/chromeos/input_method/input_method_util_unittest.cc | |
parent | 91390f66fe2393cb7842d2636dc8821950f7c5cb (diff) | |
download | chromium_src-0db3982e5f9d9f8ff43262fb00e0001ebf8c7897.zip chromium_src-0db3982e5f9d9f8ff43262fb00e0001ebf8c7897.tar.gz chromium_src-0db3982e5f9d9f8ff43262fb00e0001ebf8c7897.tar.bz2 |
Move more utility functions from language_config_model to input_method_util.
- Remove the map<string,string> argument from SortInputMethodIdsByNames() function. I'll use the reviced function to implement keyboard switching in the login window.
- Moved more utility functions from language_config_model to input_method_util.
BUG=none
TEST=trybot
Review URL: http://codereview.chromium.org/2816015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50338 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/input_method/input_method_util_unittest.cc')
-rw-r--r-- | chrome/browser/chromeos/input_method/input_method_util_unittest.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc index 3c59b6a..0c1543d 100644 --- a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc +++ b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc @@ -102,7 +102,7 @@ TEST(LanguageConfigModelTest, SortLanguageCodesByNames) { ASSERT_EQ("t", language_codes[3]); // Others } -TEST(LanguageConfigModelTest, SortInputMethodIdsByNames) { +TEST(LanguageConfigModelTest, SortInputMethodIdsByNamesInternal) { std::map<std::string, std::string> id_to_language_code_map; id_to_language_code_map.insert(std::make_pair("mozc", "ja")); id_to_language_code_map.insert(std::make_pair("mozc-jp", "ja")); @@ -112,24 +112,24 @@ TEST(LanguageConfigModelTest, SortInputMethodIdsByNames) { std::vector<std::string> input_method_ids; // Check if this function can handle an empty list. - SortInputMethodIdsByNames(id_to_language_code_map, - &input_method_ids); + SortInputMethodIdsByNamesInternal(id_to_language_code_map, + &input_method_ids); input_method_ids.push_back("mozc"); // Japanese input_method_ids.push_back("xkb:fr::fra"); // French input_method_ids.push_back("m17n:latn-pre"); // Others - SortInputMethodIdsByNames(id_to_language_code_map, - &input_method_ids); + SortInputMethodIdsByNamesInternal(id_to_language_code_map, + &input_method_ids); ASSERT_EQ(3U, input_method_ids.size()); ASSERT_EQ("xkb:fr::fra", input_method_ids[0]); // French ASSERT_EQ("mozc", input_method_ids[1]); // Japanese ASSERT_EQ("m17n:latn-pre", input_method_ids[2]); // Others // Add a duplicate entry and see if it works. - // Note that SortInputMethodIdsByNames uses std::stable_sort. + // Note that SortInputMethodIdsByNamesInternal uses std::stable_sort. input_method_ids.push_back("xkb:jp::jpn"); // also Japanese - SortInputMethodIdsByNames(id_to_language_code_map, - &input_method_ids); + SortInputMethodIdsByNamesInternal(id_to_language_code_map, + &input_method_ids); ASSERT_EQ(4U, input_method_ids.size()); ASSERT_EQ("xkb:fr::fra", input_method_ids[0]); // French ASSERT_EQ("mozc", input_method_ids[1]); // Japanese @@ -137,8 +137,8 @@ TEST(LanguageConfigModelTest, SortInputMethodIdsByNames) { ASSERT_EQ("m17n:latn-pre", input_method_ids[3]); // Others input_method_ids.push_back("mozc-jp"); // also Japanese - SortInputMethodIdsByNames(id_to_language_code_map, - &input_method_ids); + SortInputMethodIdsByNamesInternal(id_to_language_code_map, + &input_method_ids); ASSERT_EQ(5U, input_method_ids.size()); ASSERT_EQ("xkb:fr::fra", input_method_ids[0]); // French ASSERT_EQ("mozc", input_method_ids[1]); // Japanese |