| 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_manager_impl.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 manager_->EnableLayouts("en-US", ""); | 331 manager_->EnableLayouts("en-US", ""); |
| 332 EXPECT_EQ(6U, manager_->GetNumActiveInputMethods()); // 5 + French | 332 EXPECT_EQ(6U, manager_->GetNumActiveInputMethods()); // 5 + French |
| 333 // The physical layout is Japanese. | 333 // The physical layout is Japanese. |
| 334 delegate_->set_hardware_keyboard_layout("xkb:jp::jpn"); | 334 delegate_->set_hardware_keyboard_layout("xkb:jp::jpn"); |
| 335 manager_->EnableLayouts("ja", ""); | 335 manager_->EnableLayouts("ja", ""); |
| 336 // "xkb:us::eng" is not needed, hence 1. | 336 // "xkb:us::eng" is not needed, hence 1. |
| 337 EXPECT_EQ(1U, manager_->GetNumActiveInputMethods()); | 337 EXPECT_EQ(1U, manager_->GetNumActiveInputMethods()); |
| 338 } | 338 } |
| 339 | 339 |
| 340 TEST_F(InputMethodManagerImplTest, TestActiveInputMethods) { | 340 TEST_F(InputMethodManagerImplTest, TestActiveInputMethods) { |
| 341 manager_->EnableLayouts("ko", ""); // Korean | 341 manager_->EnableLayouts("ja", ""); // Japanese |
| 342 EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); | 342 EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); |
| 343 scoped_ptr<InputMethodDescriptors> methods( | 343 scoped_ptr<InputMethodDescriptors> methods( |
| 344 manager_->GetActiveInputMethods()); | 344 manager_->GetActiveInputMethods()); |
| 345 ASSERT_TRUE(methods.get()); | 345 ASSERT_TRUE(methods.get()); |
| 346 EXPECT_EQ(2U, methods->size()); | 346 EXPECT_EQ(2U, methods->size()); |
| 347 const InputMethodDescriptor* id_to_find = | 347 const InputMethodDescriptor* id_to_find = |
| 348 manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId( | 348 manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId( |
| 349 "xkb:us::eng"); | 349 "xkb:us::eng"); |
| 350 EXPECT_TRUE(Contain(*methods.get(), *id_to_find)); | 350 EXPECT_TRUE(Contain(*methods.get(), *id_to_find)); |
| 351 id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId( | 351 id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId( |
| 352 "xkb:kr:kr104:kor"); | 352 "xkb:jp::jpn"); |
| 353 EXPECT_TRUE(Contain(*methods.get(), *id_to_find)); | 353 EXPECT_TRUE(Contain(*methods.get(), *id_to_find)); |
| 354 } | 354 } |
| 355 | 355 |
| 356 TEST_F(InputMethodManagerImplTest, TestSetInputMethodConfig) { | 356 TEST_F(InputMethodManagerImplTest, TestSetInputMethodConfig) { |
| 357 InputMethodConfigValue config; | 357 InputMethodConfigValue config; |
| 358 config.type = InputMethodConfigValue::kValueTypeString; | 358 config.type = InputMethodConfigValue::kValueTypeString; |
| 359 config.string_value = "string"; | 359 config.string_value = "string"; |
| 360 EXPECT_EQ(0, controller_->set_input_method_config_internal_count_); | 360 EXPECT_EQ(0, controller_->set_input_method_config_internal_count_); |
| 361 EXPECT_TRUE(manager_->SetInputMethodConfig("section", "name", config)); | 361 EXPECT_TRUE(manager_->SetInputMethodConfig("section", "name", config)); |
| 362 EXPECT_EQ(1, controller_->set_input_method_config_internal_count_); | 362 EXPECT_EQ(1, controller_->set_input_method_config_internal_count_); |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 EXPECT_EQ("us", xkeyboard_->last_layout_); | 841 EXPECT_EQ("us", xkeyboard_->last_layout_); |
| 842 EXPECT_FALSE(manager_->SwitchInputMethod( | 842 EXPECT_FALSE(manager_->SwitchInputMethod( |
| 843 ui::Accelerator(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE))); | 843 ui::Accelerator(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE))); |
| 844 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); | 844 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); |
| 845 EXPECT_EQ("us", xkeyboard_->last_layout_); | 845 EXPECT_EQ("us", xkeyboard_->last_layout_); |
| 846 EXPECT_FALSE(manager_->SwitchInputMethod( | 846 EXPECT_FALSE(manager_->SwitchInputMethod( |
| 847 ui::Accelerator(ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE))); | 847 ui::Accelerator(ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE))); |
| 848 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); | 848 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); |
| 849 EXPECT_EQ("us", xkeyboard_->last_layout_); | 849 EXPECT_EQ("us", xkeyboard_->last_layout_); |
| 850 | 850 |
| 851 // Do the same tests for Korean. | |
| 852 EXPECT_FALSE(manager_->SwitchInputMethod( | |
| 853 ui::Accelerator(ui::VKEY_HANGUL, ui::EF_NONE))); | |
| 854 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); | |
| 855 EXPECT_EQ("us", xkeyboard_->last_layout_); | |
| 856 | |
| 857 manager_->RemoveObserver(&observer); | 851 manager_->RemoveObserver(&observer); |
| 858 } | 852 } |
| 859 | 853 |
| 860 TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpLayout) { | 854 TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpLayout) { |
| 861 // Enable "xkb:jp::jpn" and press Muhenkan/ZenkakuHankaku. | 855 // Enable "xkb:jp::jpn" and press Muhenkan/ZenkakuHankaku. |
| 862 InitComponentExtension(); | 856 InitComponentExtension(); |
| 863 InitIBusBus(); | 857 InitIBusBus(); |
| 864 manager_->EnableLayouts("ja", "xkb:us::eng"); | 858 manager_->EnableLayouts("ja", "xkb:us::eng"); |
| 865 EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); | 859 EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); |
| 866 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); | 860 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 878 EXPECT_EQ("jp", xkeyboard_->last_layout_); | 872 EXPECT_EQ("jp", xkeyboard_->last_layout_); |
| 879 manager_->SwitchToPreviousInputMethod(); | 873 manager_->SwitchToPreviousInputMethod(); |
| 880 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); | 874 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); |
| 881 EXPECT_EQ("us", xkeyboard_->last_layout_); | 875 EXPECT_EQ("us", xkeyboard_->last_layout_); |
| 882 EXPECT_TRUE(manager_->SwitchInputMethod( | 876 EXPECT_TRUE(manager_->SwitchInputMethod( |
| 883 ui::Accelerator(ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE))); | 877 ui::Accelerator(ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE))); |
| 884 EXPECT_EQ("xkb:jp::jpn", manager_->GetCurrentInputMethod().id()); | 878 EXPECT_EQ("xkb:jp::jpn", manager_->GetCurrentInputMethod().id()); |
| 885 EXPECT_EQ("jp", xkeyboard_->last_layout_); | 879 EXPECT_EQ("jp", xkeyboard_->last_layout_); |
| 886 } | 880 } |
| 887 | 881 |
| 888 TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithKoLayout) { | |
| 889 // Do the same tests for Korean. | |
| 890 InitComponentExtension(); | |
| 891 InitIBusBus(); | |
| 892 manager_->EnableLayouts("ko", "xkb:us::eng"); | |
| 893 EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); | |
| 894 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); | |
| 895 EXPECT_EQ("us", xkeyboard_->last_layout_); | |
| 896 EXPECT_TRUE(manager_->SwitchInputMethod( | |
| 897 ui::Accelerator(ui::VKEY_HANGUL, ui::EF_NONE))); | |
| 898 EXPECT_EQ("xkb:kr:kr104:kor", manager_->GetCurrentInputMethod().id()); | |
| 899 EXPECT_EQ("kr(kr104)", xkeyboard_->last_layout_); | |
| 900 manager_->SwitchToPreviousInputMethod(); | |
| 901 EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id()); | |
| 902 EXPECT_EQ("us", xkeyboard_->last_layout_); | |
| 903 EXPECT_TRUE(manager_->SwitchInputMethod( | |
| 904 ui::Accelerator(ui::VKEY_HANGUL, ui::EF_NONE))); | |
| 905 EXPECT_EQ("xkb:kr:kr104:kor", manager_->GetCurrentInputMethod().id()); | |
| 906 EXPECT_EQ("kr(kr104)", xkeyboard_->last_layout_); | |
| 907 } | |
| 908 | |
| 909 TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpIme) { | 882 TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpIme) { |
| 910 InitComponentExtension(); | 883 InitComponentExtension(); |
| 911 InitIBusBus(); | 884 InitIBusBus(); |
| 912 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); | 885 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); |
| 913 std::vector<std::string> ids; | 886 std::vector<std::string> ids; |
| 914 ids.push_back("xkb:jp::jpn"); | 887 ids.push_back("xkb:jp::jpn"); |
| 915 ids.push_back(nacl_mozc_jp_id); | 888 ids.push_back(nacl_mozc_jp_id); |
| 916 EXPECT_TRUE(manager_->EnableInputMethods(ids)); | 889 EXPECT_TRUE(manager_->EnableInputMethods(ids)); |
| 917 EXPECT_EQ("xkb:jp::jpn", manager_->GetCurrentInputMethod().id()); | 890 EXPECT_EQ("xkb:jp::jpn", manager_->GetCurrentInputMethod().id()); |
| 918 EXPECT_EQ("jp", xkeyboard_->last_layout_); | 891 EXPECT_EQ("jp", xkeyboard_->last_layout_); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 949 EXPECT_TRUE(manager_->SwitchInputMethod( | 922 EXPECT_TRUE(manager_->SwitchInputMethod( |
| 950 ui::Accelerator(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE))); | 923 ui::Accelerator(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE))); |
| 951 EXPECT_EQ(nacl_mozc_jp_id, manager_->GetCurrentInputMethod().id()); | 924 EXPECT_EQ(nacl_mozc_jp_id, manager_->GetCurrentInputMethod().id()); |
| 952 EXPECT_EQ("jp", xkeyboard_->last_layout_); | 925 EXPECT_EQ("jp", xkeyboard_->last_layout_); |
| 953 EXPECT_TRUE(manager_->SwitchInputMethod( | 926 EXPECT_TRUE(manager_->SwitchInputMethod( |
| 954 ui::Accelerator(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE))); | 927 ui::Accelerator(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE))); |
| 955 EXPECT_EQ("xkb:jp::jpn", manager_->GetCurrentInputMethod().id()); | 928 EXPECT_EQ("xkb:jp::jpn", manager_->GetCurrentInputMethod().id()); |
| 956 EXPECT_EQ("jp", xkeyboard_->last_layout_); | 929 EXPECT_EQ("jp", xkeyboard_->last_layout_); |
| 957 } | 930 } |
| 958 | 931 |
| 959 TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithKoIme) { | |
| 960 InitComponentExtension(); | |
| 961 InitIBusBus(); | |
| 962 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); | |
| 963 std::vector<std::string> ids; | |
| 964 ids.push_back("xkb:kr:kr104:kor"); | |
| 965 ids.push_back("mozc-hangul"); | |
| 966 EXPECT_TRUE(manager_->EnableInputMethods(ids)); | |
| 967 EXPECT_EQ("xkb:kr:kr104:kor", manager_->GetCurrentInputMethod().id()); | |
| 968 EXPECT_EQ("kr(kr104)", xkeyboard_->last_layout_); | |
| 969 EXPECT_TRUE(manager_->SwitchInputMethod( | |
| 970 ui::Accelerator(ui::VKEY_HANGUL, ui::EF_NONE))); | |
| 971 EXPECT_EQ("mozc-hangul", manager_->GetCurrentInputMethod().id()); | |
| 972 EXPECT_EQ("kr(kr104)", xkeyboard_->last_layout_); | |
| 973 EXPECT_TRUE(manager_->SwitchInputMethod( | |
| 974 ui::Accelerator(ui::VKEY_HANGUL, ui::EF_NONE))); | |
| 975 EXPECT_EQ("xkb:kr:kr104:kor", manager_->GetCurrentInputMethod().id()); | |
| 976 EXPECT_EQ("kr(kr104)", xkeyboard_->last_layout_); | |
| 977 | |
| 978 // Add Dvorak. | |
| 979 ids.push_back("xkb:us:dvorak:eng"); | |
| 980 EXPECT_TRUE(manager_->EnableInputMethods(ids)); | |
| 981 EXPECT_EQ("xkb:kr:kr104:kor", manager_->GetCurrentInputMethod().id()); | |
| 982 EXPECT_EQ("kr(kr104)", xkeyboard_->last_layout_); | |
| 983 EXPECT_TRUE(manager_->SwitchInputMethod( | |
| 984 ui::Accelerator(ui::VKEY_HANGUL, ui::EF_NONE))); | |
| 985 EXPECT_EQ("mozc-hangul", manager_->GetCurrentInputMethod().id()); | |
| 986 EXPECT_EQ("kr(kr104)", xkeyboard_->last_layout_); | |
| 987 EXPECT_TRUE(manager_->SwitchInputMethod( | |
| 988 ui::Accelerator(ui::VKEY_HANGUL, ui::EF_NONE))); | |
| 989 EXPECT_EQ("xkb:kr:kr104:kor", manager_->GetCurrentInputMethod().id()); | |
| 990 EXPECT_EQ("kr(kr104)", xkeyboard_->last_layout_); | |
| 991 } | |
| 992 | |
| 993 TEST_F(InputMethodManagerImplTest, TestAddRemoveExtensionInputMethods) { | 932 TEST_F(InputMethodManagerImplTest, TestAddRemoveExtensionInputMethods) { |
| 994 TestObserver observer; | 933 TestObserver observer; |
| 995 manager_->AddObserver(&observer); | 934 manager_->AddObserver(&observer); |
| 996 InitComponentExtension(); | 935 InitComponentExtension(); |
| 997 InitIBusBus(); | 936 InitIBusBus(); |
| 998 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); | 937 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); |
| 999 std::vector<std::string> ids; | 938 std::vector<std::string> ids; |
| 1000 ids.push_back("xkb:us:dvorak:eng"); | 939 ids.push_back("xkb:us:dvorak:eng"); |
| 1001 EXPECT_TRUE(manager_->EnableInputMethods(ids)); | 940 EXPECT_TRUE(manager_->EnableInputMethods(ids)); |
| 1002 EXPECT_EQ(1U, manager_->GetNumActiveInputMethods()); | 941 EXPECT_EQ(1U, manager_->GetNumActiveInputMethods()); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 EXPECT_EQ(2, mock_ibus_client_->set_global_engine_call_count()); | 1219 EXPECT_EQ(2, mock_ibus_client_->set_global_engine_call_count()); |
| 1281 EXPECT_EQ(ext_id2, mock_ibus_client_->latest_global_engine_name()); | 1220 EXPECT_EQ(ext_id2, mock_ibus_client_->latest_global_engine_name()); |
| 1282 } | 1221 } |
| 1283 | 1222 |
| 1284 TEST_F(InputMethodManagerImplTest, | 1223 TEST_F(InputMethodManagerImplTest, |
| 1285 MigrateOldInputMethodTest) { | 1224 MigrateOldInputMethodTest) { |
| 1286 std::vector<std::string> input_method_ids; | 1225 std::vector<std::string> input_method_ids; |
| 1287 input_method_ids.push_back("mozc"); | 1226 input_method_ids.push_back("mozc"); |
| 1288 input_method_ids.push_back("mozc-jp"); | 1227 input_method_ids.push_back("mozc-jp"); |
| 1289 input_method_ids.push_back("xkb:us::eng"); | 1228 input_method_ids.push_back("xkb:us::eng"); |
| 1290 input_method_ids.push_back("mozc-hangul"); | 1229 input_method_ids.push_back(nacl_mozc_us_id); |
| 1291 | 1230 |
| 1292 manager_->MigrateOldInputMethods(&input_method_ids); | 1231 manager_->MigrateOldInputMethods(&input_method_ids); |
| 1293 | 1232 |
| 1294 ASSERT_EQ(4U, input_method_ids.size()); | 1233 ASSERT_EQ(4U, input_method_ids.size()); |
| 1295 EXPECT_EQ(input_method_ids.end(), | 1234 EXPECT_EQ(input_method_ids.end(), |
| 1296 std::find(input_method_ids.begin(), input_method_ids.end(), | 1235 std::find(input_method_ids.begin(), input_method_ids.end(), |
| 1297 "mozc")); | 1236 "mozc")); |
| 1298 EXPECT_EQ(input_method_ids.end(), | 1237 EXPECT_EQ(input_method_ids.end(), |
| 1299 std::find(input_method_ids.begin(), input_method_ids.end(), | 1238 std::find(input_method_ids.begin(), input_method_ids.end(), |
| 1300 "mozc-jp")); | 1239 "mozc-jp")); |
| 1301 EXPECT_NE(input_method_ids.end(), | 1240 EXPECT_NE(input_method_ids.end(), |
| 1302 std::find(input_method_ids.begin(), input_method_ids.end(), | 1241 std::find(input_method_ids.begin(), input_method_ids.end(), |
| 1303 "xkb:us::eng")); | 1242 "xkb:us::eng")); |
| 1304 EXPECT_NE(input_method_ids.end(), | 1243 EXPECT_NE(input_method_ids.end(), |
| 1305 std::find(input_method_ids.begin(), input_method_ids.end(), | 1244 std::find(input_method_ids.begin(), input_method_ids.end(), |
| 1306 "mozc-hangul")); | 1245 nacl_mozc_us_id)); |
| 1307 | 1246 |
| 1308 } | 1247 } |
| 1309 | 1248 |
| 1310 TEST_F(InputMethodManagerImplTest, | 1249 TEST_F(InputMethodManagerImplTest, |
| 1311 AsyncComponentExtentionInitializeBeforeIBusDaemonConnection) { | 1250 AsyncComponentExtentionInitializeBeforeIBusDaemonConnection) { |
| 1312 const std::string xkb_id = "xkb:cz::cze"; | 1251 const std::string xkb_id = "xkb:cz::cze"; |
| 1313 const std::string ime_id = "mozc-hangul"; | 1252 const std::string ime_id = nacl_mozc_us_id; |
| 1314 const std::string fallback_id = "xkb:us::eng"; | 1253 const std::string fallback_id = "xkb:us::eng"; |
| 1315 std::vector<std::string> ids; | 1254 std::vector<std::string> ids; |
| 1316 ids.push_back(xkb_id); | 1255 ids.push_back(xkb_id); |
| 1317 ids.push_back(ime_id); | 1256 ids.push_back(ime_id); |
| 1318 EXPECT_TRUE(manager_->EnableInputMethods(ids)); | 1257 EXPECT_TRUE(manager_->EnableInputMethods(ids)); |
| 1319 | 1258 |
| 1320 // If component extension IME is not initialized, even XKB layout cannot be | 1259 // If component extension IME is not initialized, even XKB layout cannot be |
| 1321 // enabled. | 1260 // enabled. |
| 1322 manager_->ChangeInputMethod(xkb_id); | 1261 manager_->ChangeInputMethod(xkb_id); |
| 1323 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); | 1262 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1335 | 1274 |
| 1336 // After connection with ibus-daemon is established, previous specified input | 1275 // After connection with ibus-daemon is established, previous specified input |
| 1337 // method should be enabled automatically. | 1276 // method should be enabled automatically. |
| 1338 InitIBusBus(); | 1277 InitIBusBus(); |
| 1339 EXPECT_EQ(ime_id, manager_->GetCurrentInputMethod().id()); | 1278 EXPECT_EQ(ime_id, manager_->GetCurrentInputMethod().id()); |
| 1340 } | 1279 } |
| 1341 | 1280 |
| 1342 TEST_F(InputMethodManagerImplTest, | 1281 TEST_F(InputMethodManagerImplTest, |
| 1343 AsyncComponentExtentionInitializeAfterIBusDaemonConnection) { | 1282 AsyncComponentExtentionInitializeAfterIBusDaemonConnection) { |
| 1344 const std::string xkb_id = "xkb:cz::cze"; | 1283 const std::string xkb_id = "xkb:cz::cze"; |
| 1345 const std::string ime_id = "mozc-hangul"; | 1284 const std::string ime_id = nacl_mozc_us_id; |
| 1346 const std::string fallback_id = "xkb:us::eng"; | 1285 const std::string fallback_id = "xkb:us::eng"; |
| 1347 std::vector<std::string> ids; | 1286 std::vector<std::string> ids; |
| 1348 ids.push_back(xkb_id); | 1287 ids.push_back(xkb_id); |
| 1349 ids.push_back(ime_id); | 1288 ids.push_back(ime_id); |
| 1350 EXPECT_TRUE(manager_->EnableInputMethods(ids)); | 1289 EXPECT_TRUE(manager_->EnableInputMethods(ids)); |
| 1351 | 1290 |
| 1352 // If component extension IME is not initialized, even XKB layout cannot be | 1291 // If component extension IME is not initialized, even XKB layout cannot be |
| 1353 // enabled. | 1292 // enabled. |
| 1354 manager_->ChangeInputMethod(xkb_id); | 1293 manager_->ChangeInputMethod(xkb_id); |
| 1355 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); | 1294 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); |
| 1356 | 1295 |
| 1357 // Even after connection with ibus-daemon is established, ChangeInputMethod do | 1296 // Even after connection with ibus-daemon is established, ChangeInputMethod do |
| 1358 // nothing without component extension IME initialization. | 1297 // nothing without component extension IME initialization. |
| 1359 InitIBusBus(); | 1298 InitIBusBus(); |
| 1360 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); | 1299 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); |
| 1361 | 1300 |
| 1362 // After component extension IME is initialized, previous specified input | 1301 // After component extension IME is initialized, previous specified input |
| 1363 // method should be automatically enabled. | 1302 // method should be automatically enabled. |
| 1364 InitComponentExtension(); | 1303 InitComponentExtension(); |
| 1365 EXPECT_EQ(xkb_id, manager_->GetCurrentInputMethod().id()); | 1304 EXPECT_EQ(xkb_id, manager_->GetCurrentInputMethod().id()); |
| 1366 } | 1305 } |
| 1367 | 1306 |
| 1368 } // namespace input_method | 1307 } // namespace input_method |
| 1369 } // namespace chromeos | 1308 } // namespace chromeos |
| OLD | NEW |