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

Unified Diff: chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc

Issue 14392007: dbus: Use stubs for some clients and utils for MockDBusThreadManagerWithoutGMock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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
« no previous file with comments | « chromeos/dbus/mock_dbus_thread_manager_without_gmock.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc
diff --git a/chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc b/chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc
index 2d36b8f7ed1aca00fc4a7b6560ad5bc724a59508..c9dd2efd777e6b56db8b6a700c08c10dfb5f9451 100644
--- a/chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc
+++ b/chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc
@@ -4,6 +4,9 @@
#include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h"
+#include "chromeos/dbus/bluetooth_adapter_client.h"
+#include "chromeos/dbus/bluetooth_device_client.h"
+#include "chromeos/dbus/bluetooth_manager_client.h"
#include "chromeos/dbus/dbus_thread_manager_observer.h"
#include "chromeos/dbus/fake_bluetooth_adapter_client.h"
#include "chromeos/dbus/fake_bluetooth_agent_manager_client.h"
@@ -11,12 +14,18 @@
#include "chromeos/dbus/fake_bluetooth_input_client.h"
#include "chromeos/dbus/fake_bluetooth_profile_manager_client.h"
#include "chromeos/dbus/fake_cros_disks_client.h"
+#include "chromeos/dbus/fake_power_manager_client.h"
+#include "chromeos/dbus/fake_update_engine_client.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/image_burner_client.h"
+#include "chromeos/dbus/power_policy_controller.h"
+#include "chromeos/dbus/session_manager_client.h"
+#include "chromeos/dbus/system_clock_client.h"
namespace chromeos {
@@ -28,9 +37,29 @@ MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock()
fake_bluetooth_profile_manager_client_(
new FakeBluetoothProfileManagerClient()),
fake_cros_disks_client_(new FakeCrosDisksClient),
+ fake_power_manager_client_(new FakePowerManagerClient),
+ fake_update_engine_client_(new FakeUpdateEngineClient),
mock_ibus_client_(new MockIBusClient),
+ mock_ibus_config_client_(new MockIBusConfigClient),
mock_ibus_input_context_client_(new MockIBusInputContextClient),
+ mock_ibus_panel_service_(new MockIBusPanelService),
+ stub_bluetooth_manager_client_(
+ BluetoothManagerClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
+ stub_bluetooth_adapter_client_(
+ BluetoothAdapterClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL,
+ stub_bluetooth_manager_client_.get())),
+ stub_bluetooth_device_client_(
+ BluetoothDeviceClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL,
+ stub_bluetooth_adapter_client_.get())),
+ stub_image_burner_client_(
+ ImageBurnerClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
+ stub_session_manager_client_(
+ SessionManagerClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
+ stub_system_clock_client_(
+ SystemClockClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
satorux1 2013/04/25 07:42:03 using stubs sounds may be questionable. for now, c
Haruki Sato 2013/04/25 07:51:47 Do you mean we can add them when necessary? or Are
satorux1 2013/04/25 07:57:03 For the new bluetooth code, keybuk@ stopped provid
ibus_bus_(NULL) {
+ power_policy_controller_.reset(
+ new PowerPolicyController(this, fake_power_manager_client_.get()));
}
MockDBusThreadManagerWithoutGMock::~MockDBusThreadManagerWithoutGMock() {
@@ -67,14 +96,12 @@ dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() {
BluetoothAdapterClient*
MockDBusThreadManagerWithoutGMock::GetBluetoothAdapterClient() {
- NOTIMPLEMENTED();
- return NULL;
+ return stub_bluetooth_adapter_client_.get();
}
BluetoothDeviceClient*
MockDBusThreadManagerWithoutGMock::GetBluetoothDeviceClient() {
- NOTIMPLEMENTED();
- return NULL;
+ return stub_bluetooth_device_client_.get();
}
BluetoothInputClient*
@@ -85,8 +112,7 @@ BluetoothInputClient*
BluetoothManagerClient*
MockDBusThreadManagerWithoutGMock::GetBluetoothManagerClient() {
- NOTIMPLEMENTED();
- return NULL;
+ return stub_bluetooth_manager_client_.get();
}
BluetoothNodeClient*
@@ -177,8 +203,7 @@ GsmSMSClient* MockDBusThreadManagerWithoutGMock::GetGsmSMSClient() {
}
ImageBurnerClient* MockDBusThreadManagerWithoutGMock::GetImageBurnerClient() {
- NOTIMPLEMENTED();
- return NULL;
+ return stub_image_burner_client_.get();
}
IntrospectableClient*
@@ -200,20 +225,17 @@ PermissionBrokerClient*
}
PowerManagerClient* MockDBusThreadManagerWithoutGMock::GetPowerManagerClient() {
- NOTIMPLEMENTED();
- return NULL;
+ return fake_power_manager_client_.get();
}
PowerPolicyController*
MockDBusThreadManagerWithoutGMock::GetPowerPolicyController() {
- NOTIMPLEMENTED();
- return NULL;
+ return power_policy_controller_.get();
}
SessionManagerClient*
MockDBusThreadManagerWithoutGMock::GetSessionManagerClient() {
- NOTIMPLEMENTED();
- return NULL;
+ return stub_session_manager_client_.get();
}
SMSClient* MockDBusThreadManagerWithoutGMock::GetSMSClient() {
@@ -222,13 +244,11 @@ SMSClient* MockDBusThreadManagerWithoutGMock::GetSMSClient() {
}
SystemClockClient* MockDBusThreadManagerWithoutGMock::GetSystemClockClient() {
- NOTIMPLEMENTED();
- return NULL;
+ return stub_system_clock_client_.get();
}
UpdateEngineClient* MockDBusThreadManagerWithoutGMock::GetUpdateEngineClient() {
- NOTIMPLEMENTED();
- return NULL;
+ return fake_update_engine_client_.get();
}
BluetoothOutOfBandClient*
« no previous file with comments | « chromeos/dbus/mock_dbus_thread_manager_without_gmock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698