summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authornona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-09 10:49:25 +0000
committernona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-09 10:49:25 +0000
commitef277b6a878c77cef01a52572ec2bdd5d3659ae9 (patch)
tree244931d6ad1f2f07e701bbf26d5b7e044568a62c /chromeos
parent74422c99fe0e7d11d3d5981f279e002b167cd747 (diff)
downloadchromium_src-ef277b6a878c77cef01a52572ec2bdd5d3659ae9.zip
chromium_src-ef277b6a878c77cef01a52572ec2bdd5d3659ae9.tar.gz
chromium_src-ef277b6a878c77cef01a52572ec2bdd5d3659ae9.tar.bz2
Adds IBus related mocks into MockDBusThreadManager.
It turned out that it is quite hard to use MockDBusThreadManagerWithoutGMock for browser tests. So let me use MockDBusThreadManager instead. BUG=179912 TEST=None Review URL: https://chromiumcodereview.appspot.com/13603010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-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);
};