Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc

Issue 67313006: Delete IBusClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f50182543adf184e0447f0a281b10f2242252ac7..4aae118dfd8f99fab0d3baa26b7b46e339e341ae 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
@@ -16,7 +16,6 @@
#include "chrome/browser/chromeos/input_method/mock_candidate_window_controller.h"
#include "chrome/browser/chromeos/input_method/mock_ibus_controller.h"
#include "chromeos/dbus/fake_dbus_thread_manager.h"
-#include "chromeos/dbus/ibus/mock_ibus_client.h"
#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"
@@ -151,9 +150,6 @@ class InputMethodManagerImplTest : public testing::Test {
// Helper function to initialize IBus bus connection for testing. Do not use
// ibus related mocks before calling this function.
void InitIBusBus() {
- mock_ibus_client_ = new MockIBusClient;
- fake_dbus_thread_manager_->SetIBusClient(
- scoped_ptr<IBusClient>(mock_ibus_client_));
mock_ibus_daemon_controller_->EmulateConnect();
}
@@ -163,7 +159,6 @@ class InputMethodManagerImplTest : public testing::Test {
MockCandidateWindowController* candidate_window_controller_;
MockIBusDaemonController* mock_ibus_daemon_controller_;
scoped_ptr<MockIMEEngineHandler> mock_engine_handler_;
- MockIBusClient* mock_ibus_client_;
FakeDBusThreadManager* fake_dbus_thread_manager_;
MockXKeyboard* xkeyboard_;
base::MessageLoop message_loop_;
@@ -1113,12 +1108,10 @@ TEST_F(InputMethodManagerImplTest, TestReset) {
EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
EXPECT_EQ(0, mock_engine_handler_->reset_call_count());
manager_->ChangeInputMethod(nacl_mozc_us_id);
- EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(nacl_mozc_us_id, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(nacl_mozc_us_id, manager_->GetCurrentInputMethod().id());
EXPECT_EQ(0, mock_engine_handler_->reset_call_count());
manager_->ChangeInputMethod("xkb:us::eng");
- EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(nacl_mozc_us_id, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(nacl_mozc_us_id, manager_->GetCurrentInputMethod().id());
EXPECT_EQ(0, mock_engine_handler_->reset_call_count());
}
@@ -1133,8 +1126,7 @@ TEST_F(InputMethodManagerImplTest,
InitIBusBus();
InitComponentExtension();
- EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(nacl_mozc_us_id, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(nacl_mozc_us_id, manager_->GetCurrentInputMethod().id());
}
TEST_F(InputMethodManagerImplTest,
@@ -1150,8 +1142,7 @@ TEST_F(InputMethodManagerImplTest,
InitComponentExtension();
InitIBusBus();
- EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(nacl_mozc_jp_id, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(nacl_mozc_jp_id, manager_->GetCurrentInputMethod().id());
}
TEST_F(InputMethodManagerImplTest,
@@ -1169,8 +1160,7 @@ TEST_F(InputMethodManagerImplTest,
InitComponentExtension();
InitIBusBus();
- EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(ext_id, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(ext_id, manager_->GetCurrentInputMethod().id());
}
TEST_F(InputMethodManagerImplTest,
@@ -1194,8 +1184,7 @@ TEST_F(InputMethodManagerImplTest,
InitComponentExtension();
InitIBusBus();
- EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(ext_id2, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(ext_id2, manager_->GetCurrentInputMethod().id());
}
TEST_F(InputMethodManagerImplTest,
@@ -1211,8 +1200,7 @@ TEST_F(InputMethodManagerImplTest,
ids.push_back(ext_id);
EXPECT_TRUE(manager_->EnableInputMethods(ids));
EXPECT_EQ(1U, manager_->GetNumActiveInputMethods());
- EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(ext_id, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(ext_id, manager_->GetCurrentInputMethod().id());
}
TEST_F(InputMethodManagerImplTest,
@@ -1233,11 +1221,9 @@ TEST_F(InputMethodManagerImplTest,
ids.push_back(ext_id2);
EXPECT_TRUE(manager_->EnableInputMethods(ids));
EXPECT_EQ(2U, manager_->GetNumActiveInputMethods());
- EXPECT_EQ(1, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(ext_id1, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(ext_id1, manager_->GetCurrentInputMethod().id());
manager_->ChangeInputMethod(ext_id2);
- EXPECT_EQ(2, mock_ibus_client_->set_global_engine_call_count());
- EXPECT_EQ(ext_id2, mock_ibus_client_->latest_global_engine_name());
+ EXPECT_EQ(ext_id2, manager_->GetCurrentInputMethod().id());
}
TEST_F(InputMethodManagerImplTest,

Powered by Google App Engine
This is Rietveld 408576698