| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // input methods with medium name equal to short name | 176 // input methods with medium name equal to short name |
| 177 const char * input_method_id[] = { | 177 const char * input_method_id[] = { |
| 178 "xkb:us:altgr-intl:eng", | 178 "xkb:us:altgr-intl:eng", |
| 179 "xkb:us:dvorak:eng", | 179 "xkb:us:dvorak:eng", |
| 180 "xkb:us:intl:eng", | 180 "xkb:us:intl:eng", |
| 181 "xkb:us:colemak:eng", | 181 "xkb:us:colemak:eng", |
| 182 "xkb:de:neo:ger", | 182 "xkb:de:neo:ger", |
| 183 "xkb:es:cat:cat", | 183 "xkb:es:cat:cat", |
| 184 "xkb:gb:dvorak:eng", | 184 "xkb:gb:dvorak:eng", |
| 185 }; | 185 }; |
| 186 const int len = ARRAYSIZE_UNSAFE(input_method_id); | 186 const int len = arraysize(input_method_id); |
| 187 for (int i=0; i<len; ++i) { | 187 for (int i=0; i<len; ++i) { |
| 188 InputMethodDescriptor desc = GetDesc(input_method_id[i], "", "", ""); | 188 InputMethodDescriptor desc = GetDesc(input_method_id[i], "", "", ""); |
| 189 base::string16 medium_name = util_.GetInputMethodMediumName(desc); | 189 base::string16 medium_name = util_.GetInputMethodMediumName(desc); |
| 190 base::string16 short_name = util_.GetInputMethodShortName(desc); | 190 base::string16 short_name = util_.GetInputMethodShortName(desc); |
| 191 EXPECT_EQ(medium_name,short_name); | 191 EXPECT_EQ(medium_name,short_name); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 { | 194 { |
| 195 // input methods with medium name not equal to short name | 195 // input methods with medium name not equal to short name |
| 196 const char * input_method_id[] = { | 196 const char * input_method_id[] = { |
| 197 pinyin_ime_id, | 197 pinyin_ime_id, |
| 198 zhuyin_ime_id, | 198 zhuyin_ime_id, |
| 199 }; | 199 }; |
| 200 const int len = ARRAYSIZE_UNSAFE(input_method_id); | 200 const int len = arraysize(input_method_id); |
| 201 for (int i=0; i<len; ++i) { | 201 for (int i=0; i<len; ++i) { |
| 202 InputMethodDescriptor desc = GetDesc(input_method_id[i], "", "", ""); | 202 InputMethodDescriptor desc = GetDesc(input_method_id[i], "", "", ""); |
| 203 base::string16 medium_name = util_.GetInputMethodMediumName(desc); | 203 base::string16 medium_name = util_.GetInputMethodMediumName(desc); |
| 204 base::string16 short_name = util_.GetInputMethodShortName(desc); | 204 base::string16 short_name = util_.GetInputMethodShortName(desc); |
| 205 EXPECT_NE(medium_name,short_name); | 205 EXPECT_NE(medium_name,short_name); |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 TEST_F(InputMethodUtilTest, GetInputMethodLongNameTest) { | 210 TEST_F(InputMethodUtilTest, GetInputMethodLongNameTest) { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 EXPECT_EQ(arraysize(migration_cases), input_method_ids.size()); | 476 EXPECT_EQ(arraysize(migration_cases), input_method_ids.size()); |
| 477 for (size_t i = 0; i < arraysize(migration_cases); ++i) { | 477 for (size_t i = 0; i < arraysize(migration_cases); ++i) { |
| 478 EXPECT_EQ( | 478 EXPECT_EQ( |
| 479 extension_ime_util::GetInputMethodIDByEngineID(migration_cases[i][1]), | 479 extension_ime_util::GetInputMethodIDByEngineID(migration_cases[i][1]), |
| 480 input_method_ids[i]); | 480 input_method_ids[i]); |
| 481 } | 481 } |
| 482 } | 482 } |
| 483 | 483 |
| 484 } // namespace input_method | 484 } // namespace input_method |
| 485 } // namespace chromeos | 485 } // namespace chromeos |
| OLD | NEW |