| Index: chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
|
| diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
|
| index a42bfde542ce77836f001eade63fce4e332e2f66..68c3e298c3e4a51ac9b14778f81bf8ff62285d96 100644
|
| --- a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
|
| +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc
|
| @@ -508,7 +508,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableTwoLayouts) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| ids.push_back(ImeIdFromEngineId("xkb:us:colemak:eng"));
|
| @@ -535,7 +535,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableThreeLayouts) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| @@ -566,7 +566,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId));
|
| @@ -592,7 +592,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme2) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId));
|
| @@ -615,7 +615,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableImes) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId(kExt2Engine1Id));
|
| ids.push_back("mozc-dv");
|
| @@ -629,7 +629,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableImes) {
|
| TEST_F(InputMethodManagerImplTest, TestEnableUnknownIds) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back("xkb:tl::tlh"); // Klingon, which is not supported.
|
| ids.push_back("unknown-super-cool-ime");
|
| @@ -647,7 +647,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutsThenLock) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| @@ -664,7 +664,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutsThenLock) {
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
|
|
| // Lock screen
|
| - manager_->SetState(InputMethodManager::STATE_LOCK_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_LOCK_SCREEN);
|
| EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
|
| EXPECT_EQ(ImeIdFromEngineId(ids[1]), // still Dvorak
|
| manager_->GetCurrentInputMethod().id());
|
| @@ -675,7 +675,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutsThenLock) {
|
| EXPECT_EQ("us", keyboard_->last_layout_);
|
|
|
| // Unlock screen. The original state, Dvorak, is restored.
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
|
| EXPECT_EQ(ImeIdFromEngineId(ids[1]), manager_->GetCurrentInputMethod().id());
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
| @@ -688,7 +688,7 @@ TEST_F(InputMethodManagerImplTest, SwitchInputMethodTest) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| ids.push_back(ImeIdFromEngineId(kExt2Engine2Id));
|
| @@ -706,7 +706,7 @@ TEST_F(InputMethodManagerImplTest, SwitchInputMethodTest) {
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
|
|
| // Lock screen
|
| - manager_->SetState(InputMethodManager::STATE_LOCK_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_LOCK_SCREEN);
|
| EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); // Qwerty+Dvorak.
|
| EXPECT_EQ(ImeIdFromEngineId("xkb:us:dvorak:eng"),
|
| manager_->GetCurrentInputMethod().id());
|
| @@ -717,7 +717,7 @@ TEST_F(InputMethodManagerImplTest, SwitchInputMethodTest) {
|
| EXPECT_EQ("us", keyboard_->last_layout_);
|
|
|
| // Unlock screen. The original state, pinyin-dv, is restored.
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| EXPECT_EQ(3U, manager_->GetNumActiveInputMethods()); // Dvorak and 2 IMEs.
|
| EXPECT_EQ(ImeIdFromEngineId(ids[1]), manager_->GetCurrentInputMethod().id());
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
| @@ -728,7 +728,7 @@ TEST_F(InputMethodManagerImplTest, SwitchInputMethodTest) {
|
| TEST_F(InputMethodManagerImplTest, TestXkbSetting) {
|
| // For http://crbug.com/19655#c11 - (8), step 7-11.
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| ids.push_back(ImeIdFromEngineId("xkb:us:colemak:eng"));
|
| @@ -778,7 +778,7 @@ TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodProperties) {
|
| InitComponentExtension();
|
| EXPECT_TRUE(menu_manager_->GetCurrentInputMethodMenuItemList().empty());
|
|
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId));
|
| @@ -804,7 +804,7 @@ TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodPropertiesTwoImes) {
|
| InitComponentExtension();
|
| EXPECT_TRUE(menu_manager_->GetCurrentInputMethodMenuItemList().empty());
|
|
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId)); // Japanese
|
| ids.push_back(ImeIdFromEngineId(kExt2Engine1Id)); // T-Chinese
|
| @@ -1048,7 +1048,7 @@ TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpLayout) {
|
|
|
| TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpIme) {
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:jp::jpn"));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcJpId));
|
| @@ -1109,7 +1109,7 @@ TEST_F(InputMethodManagerImplTest, TestAddRemoveExtensionInputMethods) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| EXPECT_TRUE(manager_->ReplaceEnabledInputMethods(ids));
|
| @@ -1194,7 +1194,7 @@ TEST_F(InputMethodManagerImplTest, TestAddExtensionInputThenLockScreen) {
|
| TestObserver observer;
|
| InitComponentExtension();
|
| manager_->AddObserver(&observer);
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
|
| EXPECT_TRUE(manager_->ReplaceEnabledInputMethods(ids));
|
| @@ -1240,14 +1240,14 @@ TEST_F(InputMethodManagerImplTest, TestAddExtensionInputThenLockScreen) {
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
|
|
| // Lock the screen. This is for crosbug.com/27049.
|
| - manager_->SetState(InputMethodManager::STATE_LOCK_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_LOCK_SCREEN);
|
| EXPECT_EQ(1U, manager_->GetNumActiveInputMethods()); // Qwerty. No Ext. IME
|
| EXPECT_EQ(ImeIdFromEngineId("xkb:us::eng"),
|
| manager_->GetCurrentInputMethod().id());
|
| EXPECT_EQ("us", keyboard_->last_layout_);
|
|
|
| // Unlock the screen.
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
|
| EXPECT_EQ(ext_id, manager_->GetCurrentInputMethod().id());
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
| @@ -1265,7 +1265,7 @@ TEST_F(InputMethodManagerImplTest, TestAddExtensionInputThenLockScreen) {
|
| TEST_F(InputMethodManagerImplTest,
|
| ChangeInputMethod_ComponenteExtensionOneIME) {
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| const std::string ext_id = extension_ime_util::GetComponentInputMethodID(
|
| ime_list_[1].id,
|
| ime_list_[1].engines[0].engine_id);
|
| @@ -1279,7 +1279,7 @@ TEST_F(InputMethodManagerImplTest,
|
| TEST_F(InputMethodManagerImplTest,
|
| ChangeInputMethod_ComponenteExtensionTwoIME) {
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUISessionState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| const std::string ext_id1 = extension_ime_util::GetComponentInputMethodID(
|
| ime_list_[1].id,
|
| ime_list_[1].engines[0].engine_id);
|
|
|