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 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 InitComponentExtension(); | 1176 InitComponentExtension(); |
1177 EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count()); | 1177 EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count()); |
1178 EXPECT_EQ(nacl_mozc_us_id, mock_ibus_client_->latest_global_engine_name()); | 1178 EXPECT_EQ(nacl_mozc_us_id, mock_ibus_client_->latest_global_engine_name()); |
1179 } | 1179 } |
1180 | 1180 |
1181 TEST_F(InputMethodManagerImplTest, | 1181 TEST_F(InputMethodManagerImplTest, |
1182 ChangeInputMethodBeforeComponentExtensionInitialization_TwoIME) { | 1182 ChangeInputMethodBeforeComponentExtensionInitialization_TwoIME) { |
1183 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); | 1183 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); |
1184 std::vector<std::string> ids; | 1184 std::vector<std::string> ids; |
1185 ids.push_back(nacl_mozc_us_id); | 1185 ids.push_back(nacl_mozc_us_id); |
1186 ids.push_back("m17n:kn:itrans"); | 1186 ids.push_back(nacl_mozc_jp_id); |
1187 EXPECT_TRUE(manager_->EnableInputMethods(ids)); | 1187 EXPECT_TRUE(manager_->EnableInputMethods(ids)); |
1188 EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); | 1188 EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); |
1189 manager_->ChangeInputMethod(nacl_mozc_us_id); | 1189 manager_->ChangeInputMethod(nacl_mozc_us_id); |
1190 manager_->ChangeInputMethod("m17n:kn:itrans"); | 1190 manager_->ChangeInputMethod(nacl_mozc_jp_id); |
1191 | 1191 |
1192 InitComponentExtension(); | 1192 InitComponentExtension(); |
1193 InitIBusBus(); | 1193 InitIBusBus(); |
1194 EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count()); | 1194 EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count()); |
1195 EXPECT_EQ("m17n:kn:itrans", mock_ibus_client_->latest_global_engine_name()); | 1195 EXPECT_EQ(nacl_mozc_jp_id, mock_ibus_client_->latest_global_engine_name()); |
1196 } | 1196 } |
1197 | 1197 |
1198 TEST_F(InputMethodManagerImplTest, | 1198 TEST_F(InputMethodManagerImplTest, |
1199 ChangeInputMethodBeforeComponentExtensionInitialization_CompOneIME) { | 1199 ChangeInputMethodBeforeComponentExtensionInitialization_CompOneIME) { |
1200 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); | 1200 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); |
1201 const std::string ext_id = | 1201 const std::string ext_id = |
1202 TestableComponentExtensionIMEManager::GetComponentExtensionIMEId( | 1202 TestableComponentExtensionIMEManager::GetComponentExtensionIMEId( |
1203 ime_list_[0].id, | 1203 ime_list_[0].id, |
1204 ime_list_[0].engines[0].engine_id); | 1204 ime_list_[0].engines[0].engine_id); |
1205 std::vector<std::string> ids; | 1205 std::vector<std::string> ids; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); | 1360 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); |
1361 | 1361 |
1362 // After component extension IME is initialized, previous specified input | 1362 // After component extension IME is initialized, previous specified input |
1363 // method should be automatically enabled. | 1363 // method should be automatically enabled. |
1364 InitComponentExtension(); | 1364 InitComponentExtension(); |
1365 EXPECT_EQ(xkb_id, manager_->GetCurrentInputMethod().id()); | 1365 EXPECT_EQ(xkb_id, manager_->GetCurrentInputMethod().id()); |
1366 } | 1366 } |
1367 | 1367 |
1368 } // namespace input_method | 1368 } // namespace input_method |
1369 } // namespace chromeos | 1369 } // namespace chromeos |
OLD | NEW |