summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chromeos/chromeos.gyp1
-rw-r--r--chromeos/dbus/mock_dbus_thread_manager.cc29
-rw-r--r--chromeos/dbus/mock_dbus_thread_manager.h30
3 files changed, 56 insertions, 4 deletions
diff --git a/chromeos/chromeos.gyp b/chromeos/chromeos.gyp
index b689fac..9c7f53ef 100644
--- a/chromeos/chromeos.gyp
+++ b/chromeos/chromeos.gyp
@@ -267,6 +267,7 @@
'../build/linux/system.gyp:dbus',
'../testing/gmock.gyp:gmock',
'chromeos',
+ 'chromeos_test_support_without_gmock',
'power_manager_proto',
],
'sources': [
diff --git a/chromeos/dbus/mock_dbus_thread_manager.cc b/chromeos/dbus/mock_dbus_thread_manager.cc
index f3dbdc6..99e1a35 100644
--- a/chromeos/dbus/mock_dbus_thread_manager.cc
+++ b/chromeos/dbus/mock_dbus_thread_manager.cc
@@ -5,6 +5,12 @@
#include "chromeos/dbus/mock_dbus_thread_manager.h"
#include "chromeos/dbus/dbus_thread_manager_observer.h"
+#include "chromeos/dbus/ibus/mock_ibus_client.h"
+#include "chromeos/dbus/ibus/mock_ibus_config_client.h"
+#include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h"
+#include "chromeos/dbus/ibus/mock_ibus_engine_service.h"
+#include "chromeos/dbus/ibus/mock_ibus_input_context_client.h"
+#include "chromeos/dbus/ibus/mock_ibus_panel_service.h"
#include "chromeos/dbus/mock_bluetooth_adapter_client.h"
#include "chromeos/dbus/mock_bluetooth_device_client.h"
#include "chromeos/dbus/mock_bluetooth_input_client.h"
@@ -76,7 +82,13 @@ MockDBusThreadManager::MockDBusThreadManager()
mock_session_manager_client_(new MockSessionManagerClient),
mock_sms_client_(new MockSMSClient),
mock_system_clock_client_(new MockSystemClockClient),
- mock_update_engine_client_(new MockUpdateEngineClient) {
+ mock_update_engine_client_(new MockUpdateEngineClient),
+ mock_ibus_client_(new MockIBusClient),
+ mock_ibus_config_client_(new MockIBusConfigClient),
+ mock_ibus_input_context_client_(new MockIBusInputContextClient),
+ mock_ibus_engine_service_(new MockIBusEngineService),
+ mock_ibus_engine_factory_service_(new MockIBusEngineFactoryService),
+ mock_ibus_panel_service_(new MockIBusPanelService) {
EXPECT_CALL(*this, GetBluetoothAdapterClient())
.WillRepeatedly(Return(mock_bluetooth_adapter_client_.get()));
EXPECT_CALL(*this, GetBluetoothDeviceClient())
@@ -135,10 +147,19 @@ MockDBusThreadManager::MockDBusThreadManager()
.WillRepeatedly(Return(mock_system_clock_client()));
EXPECT_CALL(*this, GetUpdateEngineClient())
.WillRepeatedly(Return(mock_update_engine_client_.get()));
- EXPECT_CALL(*this, GetIBusInputContextClient())
- .WillRepeatedly(ReturnNull());
+ EXPECT_CALL(*this, GetIBusClient())
+ .WillRepeatedly(Return(mock_ibus_client_.get()));
EXPECT_CALL(*this, GetIBusConfigClient())
- .WillRepeatedly(ReturnNull());
+ .WillRepeatedly(Return(mock_ibus_config_client_.get()));
+ EXPECT_CALL(*this, GetIBusInputContextClient())
+ .WillRepeatedly(Return(mock_ibus_input_context_client_.get()));
+ EXPECT_CALL(*this, GetIBusEngineFactoryService())
+ .WillRepeatedly(Return(mock_ibus_engine_factory_service_.get()));
+ EXPECT_CALL(*this, GetIBusEngineService(_))
+ .WillRepeatedly(Return(mock_ibus_engine_service_.get()));
+ EXPECT_CALL(*this, GetIBusPanelService())
+ .WillRepeatedly(Return(mock_ibus_panel_service_.get()));
+
EXPECT_CALL(*this, GetSystemBus())
.WillRepeatedly(ReturnNull());
diff --git a/chromeos/dbus/mock_dbus_thread_manager.h b/chromeos/dbus/mock_dbus_thread_manager.h
index ef60c8a..3990c80 100644
--- a/chromeos/dbus/mock_dbus_thread_manager.h
+++ b/chromeos/dbus/mock_dbus_thread_manager.h
@@ -49,6 +49,12 @@ class MockSessionManagerClient;
class MockSMSClient;
class MockSystemClockClient;
class MockUpdateEngineClient;
+class MockIBusClient;
+class MockIBusConfigClient;
+class MockIBusEngineFactoryService;
+class MockIBusEngineService;
+class MockIBusInputContextClient;
+class MockIBusPanelService;
class PowerPolicyController;
// This class provides a mock DBusThreadManager with mock clients
@@ -200,6 +206,24 @@ class MockDBusThreadManager : public DBusThreadManager {
MockUpdateEngineClient* mock_update_engine_client() {
return mock_update_engine_client_.get();
}
+ MockIBusClient* mock_ibus_client() {
+ return mock_ibus_client_.get();
+ }
+ MockIBusConfigClient* mock_ibus_config_client() {
+ return mock_ibus_config_client_.get();
+ }
+ MockIBusInputContextClient* mock_ibus_input_context_client() {
+ return mock_ibus_input_context_client_.get();
+ }
+ MockIBusEngineService* mock_ibus_engine_service() {
+ return mock_ibus_engine_service_.get();
+ }
+ MockIBusEngineFactoryService* mock_ibus_engine_factory_service() {
+ return mock_ibus_engine_factory_service_.get();
+ }
+ MockIBusPanelService* mock_ibus_panel_service() {
+ return mock_ibus_panel_service_.get();
+ }
private:
// Note: Keep this before other members so they can call AddObserver() in
@@ -240,6 +264,12 @@ class MockDBusThreadManager : public DBusThreadManager {
scoped_ptr<MockSystemClockClient> mock_system_clock_client_;
scoped_ptr<MockUpdateEngineClient> mock_update_engine_client_;
scoped_ptr<PowerPolicyController> power_policy_controller_;
+ scoped_ptr<MockIBusClient> mock_ibus_client_;
+ scoped_ptr<MockIBusConfigClient> mock_ibus_config_client_;
+ scoped_ptr<MockIBusInputContextClient> mock_ibus_input_context_client_;
+ scoped_ptr<MockIBusEngineService> mock_ibus_engine_service_;
+ scoped_ptr<MockIBusEngineFactoryService> mock_ibus_engine_factory_service_;
+ scoped_ptr<MockIBusPanelService> mock_ibus_panel_service_;
DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager);
};