summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/input_method
diff options
context:
space:
mode:
authorkomatsu@chromium.org <komatsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-19 11:09:33 +0000
committerkomatsu@chromium.org <komatsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-19 11:09:33 +0000
commitb74dfd59fe25f9f22782285b5d8ab9620f554d91 (patch)
tree20125830c766625c2c5c5a10c80e086da68d4652 /chrome/browser/chromeos/input_method
parent6c5786bc93ab9917872ec0e4a0853229e9ebb2a5 (diff)
downloadchromium_src-b74dfd59fe25f9f22782285b5d8ab9620f554d91.zip
chromium_src-b74dfd59fe25f9f22782285b5d8ab9620f554d91.tar.gz
chromium_src-b74dfd59fe25f9f22782285b5d8ab9620f554d91.tar.bz2
Delete IBusDaemonController.
BUG= Review URL: https://codereview.chromium.org/64823008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/input_method')
-rw-r--r--chrome/browser/chromeos/input_method/candidate_window_controller_impl.h1
-rw-r--r--chrome/browser/chromeos/input_method/input_method_configuration.cc3
-rw-r--r--chrome/browser/chromeos/input_method/input_method_engine_ibus.cc7
-rw-r--r--chrome/browser/chromeos/input_method/input_method_engine_ibus.h6
-rw-r--r--chrome/browser/chromeos/input_method/input_method_manager_impl.cc33
-rw-r--r--chrome/browser/chromeos/input_method/input_method_manager_impl.h9
-rw-r--r--chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc127
7 files changed, 1 insertions, 185 deletions
diff --git a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.h b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.h
index b1dfc8a..70deb44 100644
--- a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.h
+++ b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.h
@@ -12,7 +12,6 @@
#include "chrome/browser/chromeos/input_method/candidate_window_view.h"
#include "chrome/browser/chromeos/input_method/infolist_window_view.h"
#include "chromeos/ime/ibus_bridge.h"
-#include "chromeos/ime/ibus_daemon_controller.h"
namespace views {
class Widget;
diff --git a/chrome/browser/chromeos/input_method/input_method_configuration.cc b/chrome/browser/chromeos/input_method/input_method_configuration.cc
index e44eefa..7ed92d1 100644
--- a/chrome/browser/chromeos/input_method/input_method_configuration.cc
+++ b/chrome/browser/chromeos/input_method/input_method_configuration.cc
@@ -31,9 +31,7 @@ void OnSessionStateChange(InputMethodManagerImpl* input_method_manager_impl,
void Initialize(
const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner,
const scoped_refptr<base::SequencedTaskRunner>& file_task_runner) {
- IBusDaemonController::Initialize(ui_task_runner, file_task_runner);
IBusBridge::Initialize();
- IBusDaemonController::GetInstance()->Start();
InputMethodManagerImpl* impl = new InputMethodManagerImpl(
scoped_ptr<InputMethodDelegate>(new InputMethodDelegateImpl));
@@ -61,7 +59,6 @@ void Shutdown() {
InputMethodManager::Shutdown();
IBusBridge::Shutdown();
- IBusDaemonController::Shutdown();
DVLOG(1) << "InputMethodManager shutdown";
}
diff --git a/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc b/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
index 682a529..c2ed60e 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
@@ -569,13 +569,6 @@ void InputMethodEngineIBus::MenuItemToProperty(
// TODO(nona): Support item.children.
}
-void InputMethodEngineIBus::OnConnected() {
- RegisterComponent();
-}
-
-void InputMethodEngineIBus::OnDisconnected() {
-}
-
void InputMethodEngineIBus::RegisterComponent() {
IBusBridge::Get()->SetCreateEngineHandler(
ibus_id_,
diff --git a/chrome/browser/chromeos/input_method/input_method_engine_ibus.h b/chrome/browser/chromeos/input_method/input_method_engine_ibus.h
index bd9c81b..dc92c82 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine_ibus.h
+++ b/chrome/browser/chromeos/input_method/input_method_engine_ibus.h
@@ -93,12 +93,6 @@ class InputMethodEngineIBus : public InputMethodEngine,
virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos,
uint32 anchor_pos) OVERRIDE;
- // Called when the connection with ibus-daemon is connected.
- void OnConnected();
-
- // Called whtn the connection with ibus-daemon is disconnected.
- void OnDisconnected();
-
private:
// Converts MenuItem to InputMethodProperty.
void MenuItemToProperty(const MenuItem& item,
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index 0fe1eb2..5303093 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -56,13 +56,11 @@ InputMethodManagerImpl::InputMethodManagerImpl(
util_(delegate_.get(), GetSupportedInputMethods()),
component_extension_ime_manager_(new ComponentExtensionIMEManager()),
weak_ptr_factory_(this) {
- IBusDaemonController::GetInstance()->AddObserver(this);
}
InputMethodManagerImpl::~InputMethodManagerImpl() {
if (ibus_controller_.get())
ibus_controller_->RemoveObserver(this);
- IBusDaemonController::GetInstance()->RemoveObserver(this);
if (candidate_window_controller_.get()) {
candidate_window_controller_->RemoveObserver(this);
candidate_window_controller_->Shutdown();
@@ -222,9 +220,6 @@ void InputMethodManagerImpl::ReconfigureIMFramework() {
// indicator is used by only keyboard layout input methods.
if (need_engine || active_input_method_ids_.size() > 1)
MaybeInitializeCandidateWindowController();
-
- if (need_engine)
- IBusDaemonController::GetInstance()->Start();
}
bool InputMethodManagerImpl::EnableInputMethod(
@@ -454,7 +449,6 @@ void InputMethodManagerImpl::AddInputMethodExtension(
// Ensure that the input method daemon is running.
MaybeInitializeCandidateWindowController();
- IBusDaemonController::GetInstance()->Start();
}
extra_input_method_instances_[id] =
@@ -539,7 +533,6 @@ void InputMethodManagerImpl::SetEnabledExtensionImes(
if (active_imes_changed) {
MaybeInitializeCandidateWindowController();
- IBusDaemonController::GetInstance()->Start();
// If |current_input_method| is no longer in |active_input_method_ids_|,
// switch to the first one in |active_input_method_ids_|.
@@ -714,32 +707,6 @@ ComponentExtensionIMEManager*
return component_extension_ime_manager_.get();
}
-void InputMethodManagerImpl::OnConnected() {
- for (std::map<std::string, InputMethodEngineIBus*>::iterator ite =
- extra_input_method_instances_.begin();
- ite != extra_input_method_instances_.end();
- ite++) {
- if (Contains(enabled_extension_imes_, ite->first) ||
- (component_extension_ime_manager_->IsInitialized() &&
- component_extension_ime_manager_->IsWhitelisted(ite->first))) {
- ite->second->OnConnected();
- }
- }
-
- if (!pending_input_method_.empty())
- ChangeInputMethodInternal(pending_input_method_, false);
-}
-
-void InputMethodManagerImpl::OnDisconnected() {
- for (std::map<std::string, InputMethodEngineIBus*>::iterator ite =
- extra_input_method_instances_.begin();
- ite != extra_input_method_instances_.end();
- ite++) {
- if (Contains(enabled_extension_imes_, ite->first))
- ite->second->OnDisconnected();
- }
-}
-
void InputMethodManagerImpl::InitializeComponentExtension() {
ComponentExtensionIMEManagerImpl* impl =
new ComponentExtensionIMEManagerImpl();
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.h b/chrome/browser/chromeos/input_method/input_method_manager_impl.h
index 900891b..009af4c 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.h
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.h
@@ -15,7 +15,6 @@
#include "chrome/browser/chromeos/input_method/candidate_window_controller.h"
#include "chrome/browser/chromeos/input_method/ibus_controller.h"
#include "chrome/browser/chromeos/input_method/input_method_util.h"
-#include "chromeos/ime/ibus_daemon_controller.h"
#include "chromeos/ime/input_method_manager.h"
#include "chromeos/ime/input_method_whitelist.h"
@@ -30,8 +29,7 @@ class XKeyboard;
// The implementation of InputMethodManager.
class InputMethodManagerImpl : public InputMethodManager,
public CandidateWindowController::Observer,
- public IBusController::Observer,
- public IBusDaemonController::Observer {
+ public IBusController::Observer {
public:
// Constructs an InputMethodManager instance. The client is responsible for
// calling |SetState| in response to relevant changes in browser state.
@@ -110,11 +108,6 @@ class InputMethodManagerImpl : public InputMethodManager,
// IBusController overrides:
virtual void PropertyChanged() OVERRIDE;
- // IBusDaemonController overrides:
- virtual void OnConnected() OVERRIDE;
- virtual void OnDisconnected() OVERRIDE;
-
-
// CandidateWindowController::Observer overrides:
virtual void CandidateWindowOpened() OVERRIDE;
virtual void CandidateWindowClosed() OVERRIDE;
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 aa38eea..bcd27c1 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
@@ -19,7 +19,6 @@
#include "chromeos/ime/extension_ime_util.h"
#include "chromeos/ime/fake_input_method_delegate.h"
#include "chromeos/ime/mock_component_extension_ime_manager_delegate.h"
-#include "chromeos/ime/mock_ibus_daemon_controller.h"
#include "chromeos/ime/mock_ime_engine_handler.h"
#include "chromeos/ime/mock_xkeyboard.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -57,9 +56,6 @@ class InputMethodManagerImplTest : public testing::Test {
virtual ~InputMethodManagerImplTest() {}
virtual void SetUp() OVERRIDE {
- mock_ibus_daemon_controller_ = new chromeos::MockIBusDaemonController();
- chromeos::IBusDaemonController::InitializeForTesting(
- mock_ibus_daemon_controller_);
fake_dbus_thread_manager_ =
new chromeos::FakeDBusThreadManager();
chromeos::DBusThreadManager::InitializeForTesting(
@@ -121,12 +117,9 @@ class InputMethodManagerImplTest : public testing::Test {
ext2.engines.push_back(ext2_engine2);
ime_list_.push_back(ext2);
-
- mock_ibus_daemon_controller_->EmulateConnect();
}
virtual void TearDown() OVERRIDE {
- mock_ibus_daemon_controller_->EmulateDisconnect();
delegate_ = NULL;
controller_ = NULL;
candidate_window_controller_ = NULL;
@@ -135,7 +128,6 @@ class InputMethodManagerImplTest : public testing::Test {
IBusBridge::Get()->SetEngineHandler(NULL);
IBusBridge::Shutdown();
chromeos::DBusThreadManager::Shutdown();
- chromeos::IBusDaemonController::Shutdown();
}
protected:
@@ -147,17 +139,10 @@ class InputMethodManagerImplTest : public testing::Test {
manager_->InitializeComponentExtensionForTesting(delegate.Pass());
}
- // Helper function to initialize IBus bus connection for testing. Do not use
- // ibus related mocks before calling this function.
- void InitIBusBus() {
- mock_ibus_daemon_controller_->EmulateConnect();
- }
-
scoped_ptr<InputMethodManagerImpl> manager_;
FakeInputMethodDelegate* delegate_;
MockIBusController* controller_;
MockCandidateWindowController* candidate_window_controller_;
- MockIBusDaemonController* mock_ibus_daemon_controller_;
scoped_ptr<MockIMEEngineHandler> mock_engine_handler_;
FakeDBusThreadManager* fake_dbus_thread_manager_;
MockXKeyboard* xkeyboard_;
@@ -253,7 +238,6 @@ TEST_F(InputMethodManagerImplTest, TestObserver) {
// also for the scenario.
TestObserver observer;
InitComponentExtension();
- InitIBusBus();
manager_->AddObserver(&observer);
EXPECT_EQ(0, observer.input_method_changed_count_);
manager_->EnableLayouts("en-US", "xkb:us::eng");
@@ -279,7 +263,6 @@ TEST_F(InputMethodManagerImplTest, TestObserver) {
TEST_F(InputMethodManagerImplTest, TestGetSupportedInputMethods) {
InitComponentExtension();
- InitIBusBus();
scoped_ptr<InputMethodDescriptors> methods(
manager_->GetSupportedInputMethods());
ASSERT_TRUE(methods.get());
@@ -303,19 +286,15 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayouts) {
// Currently 5 keyboard layouts are supported for en-US, and 1 for ja. See
// ibus_input_method.txt.
InitComponentExtension();
- InitIBusBus();
manager_->EnableLayouts("en-US", "");
EXPECT_EQ(5U, manager_->GetNumActiveInputMethods());
for (size_t i = 0; i < manager_->GetActiveInputMethodIds().size(); ++i)
LOG(ERROR) << manager_->GetActiveInputMethodIds().at(i);
- // For http://crbug.com/19655#c11 - (2)
- EXPECT_EQ(0, mock_ibus_daemon_controller_->start_count());
// For http://crbug.com/19655#c11 - (5)
// The hardware keyboard layout "xkb:us::eng" is always active, hence 2U.
manager_->EnableLayouts("ja", ""); // Japanese
EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
- EXPECT_EQ(0, mock_ibus_daemon_controller_->start_count());
}
TEST_F(InputMethodManagerImplTest, TestEnableLayoutsNonUsHardwareKeyboard) {
@@ -351,7 +330,6 @@ TEST_F(InputMethodManagerImplTest, TestEnableTwoLayouts) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:us:dvorak:eng");
@@ -360,7 +338,6 @@ TEST_F(InputMethodManagerImplTest, TestEnableTwoLayouts) {
EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
// Since all the IDs added avobe are keyboard layouts, Start() should not be
// called.
- EXPECT_EQ(0, mock_ibus_daemon_controller_->start_count());
EXPECT_EQ(1, observer.input_method_changed_count_);
EXPECT_EQ(ids[0], manager_->GetCurrentInputMethod().id());
EXPECT_EQ("us(dvorak)", xkeyboard_->last_layout_);
@@ -380,7 +357,6 @@ TEST_F(InputMethodManagerImplTest, TestEnableThreeLayouts) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:us::eng");
@@ -412,13 +388,11 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:us:dvorak:eng");
ids.push_back(nacl_mozc_us_id);
EXPECT_TRUE(manager_->EnableInputMethods(ids));
- EXPECT_EQ(1, mock_ibus_daemon_controller_->start_count());
EXPECT_EQ(1, observer.input_method_changed_count_);
EXPECT_EQ(ids[0], manager_->GetCurrentInputMethod().id());
EXPECT_EQ("us(dvorak)", xkeyboard_->last_layout_);
@@ -433,14 +407,6 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme) {
EXPECT_EQ(1U, manager_->GetNumActiveInputMethods());
EXPECT_EQ(ids[0], manager_->GetCurrentInputMethod().id());
EXPECT_EQ("us(dvorak)", xkeyboard_->last_layout_);
- // Currently, to work around a crash issue at crosbug.com/27051,
- // controller_->Stop(); is NOT called when all IMEs are disabled
- // or on shutdown.
- EXPECT_EQ(0, mock_ibus_daemon_controller_->stop_count());
-
- manager_->SetState(InputMethodManager::STATE_TERMINATING);
- EXPECT_EQ(0, mock_ibus_daemon_controller_->stop_count());
- manager_->RemoveObserver(&observer);
}
TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme2) {
@@ -448,13 +414,11 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutAndIme2) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:us:dvorak:eng");
ids.push_back(nacl_mozc_us_id);
EXPECT_TRUE(manager_->EnableInputMethods(ids));
- EXPECT_EQ(1, mock_ibus_daemon_controller_->start_count());
EXPECT_EQ(1, observer.input_method_changed_count_);
EXPECT_EQ(ids[0], manager_->GetCurrentInputMethod().id());
EXPECT_EQ("us(dvorak)", xkeyboard_->last_layout_);
@@ -473,13 +437,11 @@ TEST_F(InputMethodManagerImplTest, TestEnableImes) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("_comp_ime_nmblnjkfdkabgdofidlkienfnnbjhnabext2_engine1_engine_id");
ids.push_back("mozc-dv");
EXPECT_TRUE(manager_->EnableInputMethods(ids));
- EXPECT_EQ(1, mock_ibus_daemon_controller_->start_count());
EXPECT_EQ(1, observer.input_method_changed_count_);
EXPECT_EQ(ids[0], manager_->GetCurrentInputMethod().id());
EXPECT_EQ("us", xkeyboard_->last_layout_);
@@ -507,7 +469,6 @@ TEST_F(InputMethodManagerImplTest, TestEnableLayoutsThenLock) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:us::eng");
@@ -549,7 +510,6 @@ TEST_F(InputMethodManagerImplTest, SwithchInputMethodTest) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:us:dvorak:eng");
@@ -573,9 +533,6 @@ TEST_F(InputMethodManagerImplTest, SwithchInputMethodTest) {
EXPECT_EQ("xkb:us:dvorak:eng",
manager_->GetCurrentInputMethod().id());
EXPECT_EQ("us(dvorak)", xkeyboard_->last_layout_);
- // controller_->Stop() should never be called when the screen is locked even
- // after crosbug.com/27051 is fixed.
- EXPECT_EQ(0, mock_ibus_daemon_controller_->stop_count());
manager_->SwitchToNextInputMethod();
EXPECT_EQ("xkb:us::eng", // The hardware keyboard layout.
manager_->GetCurrentInputMethod().id());
@@ -593,7 +550,6 @@ TEST_F(InputMethodManagerImplTest, SwithchInputMethodTest) {
TEST_F(InputMethodManagerImplTest, TestXkbSetting) {
// For http://crbug.com/19655#c11 - (8), step 7-11.
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:us:dvorak:eng");
@@ -636,7 +592,6 @@ TEST_F(InputMethodManagerImplTest, TestActivateInputMethodProperty) {
TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodProperties) {
InitComponentExtension();
- InitIBusBus();
EXPECT_TRUE(manager_->GetCurrentInputMethodProperties().empty());
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
@@ -671,7 +626,6 @@ TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodProperties) {
TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodPropertiesTwoImes) {
InitComponentExtension();
- InitIBusBus();
EXPECT_TRUE(manager_->GetCurrentInputMethodProperties().empty());
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
@@ -714,7 +668,6 @@ TEST_F(InputMethodManagerImplTest, TestNextInputMethod) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
// For http://crbug.com/19655#c11 - (1)
manager_->EnableLayouts("en-US", "xkb:us::eng");
EXPECT_EQ(5U, manager_->GetNumActiveInputMethods());
@@ -748,7 +701,6 @@ TEST_F(InputMethodManagerImplTest, TestPreviousInputMethod) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
ui::Accelerator keydown_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
keydown_accelerator.set_type(ui::ET_KEY_PRESSED);
@@ -805,7 +757,6 @@ TEST_F(InputMethodManagerImplTest,
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
ui::Accelerator keydown_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
keydown_accelerator.set_type(ui::ET_KEY_PRESSED);
@@ -829,7 +780,6 @@ TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithUsLayouts) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->EnableLayouts("en-US", "xkb:us::eng");
EXPECT_EQ(5U, manager_->GetNumActiveInputMethods());
EXPECT_EQ("xkb:us::eng", manager_->GetCurrentInputMethod().id());
@@ -861,7 +811,6 @@ TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithUsLayouts) {
TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpLayout) {
// Enable "xkb:jp::jpn" and press Muhenkan/ZenkakuHankaku.
InitComponentExtension();
- InitIBusBus();
ui::Accelerator keydown_accelerator(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN);
keydown_accelerator.set_type(ui::ET_KEY_PRESSED);
@@ -896,7 +845,6 @@ TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpLayout) {
TEST_F(InputMethodManagerImplTest, TestSwitchInputMethodWithJpIme) {
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:jp::jpn");
@@ -948,13 +896,11 @@ TEST_F(InputMethodManagerImplTest, TestAddRemoveExtensionInputMethods) {
TestObserver observer;
manager_->AddObserver(&observer);
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
ids.push_back("xkb:us:dvorak:eng");
EXPECT_TRUE(manager_->EnableInputMethods(ids));
EXPECT_EQ(1U, manager_->GetNumActiveInputMethods());
- EXPECT_EQ(0, mock_ibus_daemon_controller_->start_count());
EXPECT_EQ(1, observer.input_method_changed_count_);
EXPECT_EQ(ids[0],
manager_->GetCurrentInputMethod().id());
@@ -983,8 +929,6 @@ TEST_F(InputMethodManagerImplTest, TestAddRemoveExtensionInputMethods) {
manager_->SetEnabledExtensionImes(&extension_ime_ids);
EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
- // should be started.
- EXPECT_EQ(1, mock_ibus_daemon_controller_->start_count());
{
scoped_ptr<InputMethodDescriptors> methods(
manager_->GetActiveInputMethods());
@@ -1023,17 +967,11 @@ TEST_F(InputMethodManagerImplTest, TestAddRemoveExtensionInputMethods) {
manager_->RemoveInputMethodExtension(
extension_ime_util::GetInputMethodID("cafebabe", "engine_id"));
EXPECT_EQ(1U, manager_->GetNumActiveInputMethods());
- // Currently, to work around a crash issue at crosbug.com/27051,
- // controller_->Stop(); is NOT called when all (extension) IMEs are disabled.
- EXPECT_EQ(0, mock_ibus_daemon_controller_->stop_count());
-
- manager_->RemoveObserver(&observer);
}
TEST_F(InputMethodManagerImplTest, TestAddExtensionInputThenLockScreen) {
TestObserver observer;
InitComponentExtension();
- InitIBusBus();
manager_->AddObserver(&observer);
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
std::vector<std::string> ids;
@@ -1080,7 +1018,6 @@ TEST_F(InputMethodManagerImplTest, TestAddExtensionInputThenLockScreen) {
EXPECT_EQ("xkb:us::eng",
manager_->GetCurrentInputMethod().id());
EXPECT_EQ("us", xkeyboard_->last_layout_);
- EXPECT_EQ(0, mock_ibus_daemon_controller_->stop_count());
// Unlock the screen.
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
@@ -1109,7 +1046,6 @@ TEST_F(InputMethodManagerImplTest,
EXPECT_EQ(1U, manager_->GetNumActiveInputMethods());
manager_->ChangeInputMethod(nacl_mozc_us_id);
- InitIBusBus();
InitComponentExtension();
EXPECT_EQ(nacl_mozc_us_id, manager_->GetCurrentInputMethod().id());
}
@@ -1126,7 +1062,6 @@ TEST_F(InputMethodManagerImplTest,
manager_->ChangeInputMethod(nacl_mozc_jp_id);
InitComponentExtension();
- InitIBusBus();
EXPECT_EQ(nacl_mozc_jp_id, manager_->GetCurrentInputMethod().id());
}
@@ -1144,7 +1079,6 @@ TEST_F(InputMethodManagerImplTest,
manager_->ChangeInputMethod(ext_id);
InitComponentExtension();
- InitIBusBus();
EXPECT_EQ(ext_id, manager_->GetCurrentInputMethod().id());
}
@@ -1168,14 +1102,12 @@ TEST_F(InputMethodManagerImplTest,
manager_->ChangeInputMethod(ext_id2);
InitComponentExtension();
- InitIBusBus();
EXPECT_EQ(ext_id2, manager_->GetCurrentInputMethod().id());
}
TEST_F(InputMethodManagerImplTest,
ChangeInputMethod_ComponenteExtensionOneIME) {
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
const std::string ext_id =
TestableComponentExtensionIMEManager::GetComponentExtensionIMEId(
@@ -1191,7 +1123,6 @@ TEST_F(InputMethodManagerImplTest,
TEST_F(InputMethodManagerImplTest,
ChangeInputMethod_ComponenteExtensionTwoIME) {
InitComponentExtension();
- InitIBusBus();
manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN);
const std::string ext_id1 =
TestableComponentExtensionIMEManager::GetComponentExtensionIMEId(
@@ -1211,63 +1142,5 @@ TEST_F(InputMethodManagerImplTest,
EXPECT_EQ(ext_id2, manager_->GetCurrentInputMethod().id());
}
-TEST_F(InputMethodManagerImplTest,
- AsyncComponentExtentionInitializeBeforeIBusDaemonConnection) {
- const std::string xkb_id = "xkb:cz::cze";
- const std::string ime_id = nacl_mozc_us_id;
- const std::string fallback_id = "xkb:us::eng";
- std::vector<std::string> ids;
- ids.push_back(xkb_id);
- ids.push_back(ime_id);
- EXPECT_TRUE(manager_->EnableInputMethods(ids));
-
- // If component extension IME is not initialized, even XKB layout cannot be
- // enabled.
- manager_->ChangeInputMethod(xkb_id);
- EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id());
-
- // After component extension IME is initialized, previous input method should
- // be automatically enabled.
- InitComponentExtension();
- EXPECT_EQ(xkb_id, manager_->GetCurrentInputMethod().id());
-
- // However input method should not be enabled before establishment of
- // connection with ibus-daemon.
- manager_->ChangeInputMethod(ime_id);
- // TODO(nona): Write expectation, GetCurrentInputMethod returns |ime_id| even
- // the actual input method is not changed.
-
- // After connection with ibus-daemon is established, previous specified input
- // method should be enabled automatically.
- InitIBusBus();
- EXPECT_EQ(ime_id, manager_->GetCurrentInputMethod().id());
-}
-
-TEST_F(InputMethodManagerImplTest,
- AsyncComponentExtentionInitializeAfterIBusDaemonConnection) {
- const std::string xkb_id = "xkb:cz::cze";
- const std::string ime_id = nacl_mozc_us_id;
- const std::string fallback_id = "xkb:us::eng";
- std::vector<std::string> ids;
- ids.push_back(xkb_id);
- ids.push_back(ime_id);
- EXPECT_TRUE(manager_->EnableInputMethods(ids));
-
- // If component extension IME is not initialized, even XKB layout cannot be
- // enabled.
- manager_->ChangeInputMethod(xkb_id);
- EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id());
-
- // Even after connection with ibus-daemon is established, ChangeInputMethod do
- // nothing without component extension IME initialization.
- InitIBusBus();
- EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id());
-
- // After component extension IME is initialized, previous specified input
- // method should be automatically enabled.
- InitComponentExtension();
- EXPECT_EQ(xkb_id, manager_->GetCurrentInputMethod().id());
-}
-
} // namespace input_method
} // namespace chromeos