| 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 ba24c4251aeb32263489ccc4f6f442d5001b5250..142b8951a93b030b4ccc638814b8f2faeed7173d 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
|
| @@ -502,7 +502,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableTwoLayouts) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(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"));
|
| @@ -529,7 +529,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableThreeLayouts) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| @@ -560,7 +560,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId));
|
| @@ -586,7 +586,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme2) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId));
|
| @@ -609,7 +609,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableImes) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId(kExt2Engine1Id));
|
| ids.push_back("mozc-dv");
|
| @@ -623,7 +623,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableImes) {
|
| TEST_F(InputMethodManagerImplTest, TestEnableUnknownIds) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(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");
|
| @@ -641,7 +641,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutsThenLock) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| @@ -658,7 +658,7 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutsThenLock) {
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
|
|
| // Lock screen
|
| - manager_->SetState(InputMethodManager::STATE_LOCK_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_LOCK_SCREEN);
|
| EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
|
| EXPECT_EQ(ImeIdFromEngineId(ids[1]), // still Dvorak
|
| manager_->GetCurrentInputMethod().id());
|
| @@ -669,7 +669,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_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
|
| EXPECT_EQ(ImeIdFromEngineId(ids[1]), manager_->GetCurrentInputMethod().id());
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
| @@ -682,7 +682,7 @@ TEST_F(InputMethodManagerImplTest, SwitchInputMethodTest) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| ids.push_back(ImeIdFromEngineId(kExt2Engine2Id));
|
| @@ -700,7 +700,7 @@ TEST_F(InputMethodManagerImplTest, SwitchInputMethodTest) {
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
|
|
| // Lock screen
|
| - manager_->SetState(InputMethodManager::STATE_LOCK_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_LOCK_SCREEN);
|
| EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); // Qwerty+Dvorak.
|
| EXPECT_EQ(ImeIdFromEngineId("xkb:us:dvorak:eng"),
|
| manager_->GetCurrentInputMethod().id());
|
| @@ -711,7 +711,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_->SetUIState(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_);
|
| @@ -722,7 +722,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_->SetUIState(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"));
|
| @@ -772,7 +772,7 @@ TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodProperties) {
|
| InitComponentExtension();
|
| EXPECT_TRUE(menu_manager_->GetCurrentInputMethodMenuItemList().empty());
|
|
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId));
|
| @@ -798,7 +798,7 @@ TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodPropertiesTwoImes) {
|
| InitComponentExtension();
|
| EXPECT_TRUE(menu_manager_->GetCurrentInputMethodMenuItemList().empty());
|
|
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId)); // Japanese
|
| ids.push_back(ImeIdFromEngineId(kExt2Engine1Id)); // T-Chinese
|
| @@ -1042,7 +1042,7 @@ TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpLayout) {
|
|
|
| TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpIme) {
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:jp::jpn"));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcJpId));
|
| @@ -1103,7 +1103,7 @@ TEST_F(InputMethodManagerImplTest, TestAddRemoveExtensionInputMethods) {
|
| TestObserver observer;
|
| manager_->AddObserver(&observer);
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us:dvorak:eng"));
|
| EXPECT_TRUE(manager_->ReplaceEnabledInputMethods(ids));
|
| @@ -1184,7 +1184,7 @@ TEST_F(InputMethodManagerImplTest, TestAddExtensionInputThenLockScreen) {
|
| TestObserver observer;
|
| InitComponentExtension();
|
| manager_->AddObserver(&observer);
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId("xkb:us::eng"));
|
| EXPECT_TRUE(manager_->ReplaceEnabledInputMethods(ids));
|
| @@ -1228,14 +1228,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_->SetUIState(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_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
|
| EXPECT_EQ(ext_id, manager_->GetCurrentInputMethod().id());
|
| EXPECT_EQ("us(dvorak)", keyboard_->last_layout_);
|
| @@ -1252,7 +1252,7 @@ TEST_F(InputMethodManagerImplTest, TestAddExtensionInputThenLockScreen) {
|
|
|
| TEST_F(InputMethodManagerImplTest,
|
| ChangeInputMethodBeforeComponentExtensionInitialization_OneIME) {
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId));
|
| EXPECT_TRUE(manager_->ReplaceEnabledInputMethods(ids));
|
| @@ -1266,7 +1266,7 @@ TEST_F(InputMethodManagerImplTest,
|
|
|
| TEST_F(InputMethodManagerImplTest,
|
| ChangeInputMethodBeforeComponentExtensionInitialization_TwoIME) {
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| std::vector<std::string> ids;
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcUsId));
|
| ids.push_back(ImeIdFromEngineId(kNaclMozcJpId));
|
| @@ -1282,7 +1282,7 @@ TEST_F(InputMethodManagerImplTest,
|
|
|
| TEST_F(InputMethodManagerImplTest,
|
| ChangeInputMethodBeforeComponentExtensionInitialization_CompOneIME) {
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| const std::string ext_id = extension_ime_util::GetComponentInputMethodID(
|
| ime_list_[1].id,
|
| ime_list_[1].engines[0].engine_id);
|
| @@ -1298,7 +1298,7 @@ TEST_F(InputMethodManagerImplTest,
|
|
|
| TEST_F(InputMethodManagerImplTest,
|
| ChangeInputMethodBeforeComponentExtensionInitialization_CompTwoIME) {
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| const std::string ext_id1 = extension_ime_util::GetComponentInputMethodID(
|
| ime_list_[1].id,
|
| ime_list_[1].engines[0].engine_id);
|
| @@ -1320,7 +1320,7 @@ TEST_F(InputMethodManagerImplTest,
|
| TEST_F(InputMethodManagerImplTest,
|
| ChangeInputMethod_ComponenteExtensionOneIME) {
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| const std::string ext_id = extension_ime_util::GetComponentInputMethodID(
|
| ime_list_[1].id,
|
| ime_list_[1].engines[0].engine_id);
|
| @@ -1334,7 +1334,7 @@ TEST_F(InputMethodManagerImplTest,
|
| TEST_F(InputMethodManagerImplTest,
|
| ChangeInputMethod_ComponenteExtensionTwoIME) {
|
| InitComponentExtension();
|
| - manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| + manager_->SetUIState(InputMethodManager::STATE_BROWSER_SCREEN);
|
| const std::string ext_id1 = extension_ime_util::GetComponentInputMethodID(
|
| ime_list_[1].id,
|
| ime_list_[1].engines[0].engine_id);
|
|
|