diff options
author | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-19 15:16:20 +0000 |
---|---|---|
committer | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-19 15:16:20 +0000 |
commit | 7b231ad5294752f0f0f006ab55aff04d013ce28a (patch) | |
tree | f9deeb2d16da22b268e1eb435388f42ccd7bf47a /chromeos/dbus | |
parent | 98607348a7f9eeea19f16658998b1327b0816511 (diff) | |
download | chromium_src-7b231ad5294752f0f0f006ab55aff04d013ce28a.zip chromium_src-7b231ad5294752f0f0f006ab55aff04d013ce28a.tar.gz chromium_src-7b231ad5294752f0f0f006ab55aff04d013ce28a.tar.bz2 |
Separate NetworkDeviceHandler interface from its implementation.
This is required for unit testing classes using NetworkDeviceHandler.
While there, adapts the NetworkDeviceHandler unit test to set up its own Shill DBusClients (i.e. no other clients are created and the default Shill stub environment isn't used).
BUG=323537
Review URL: https://codereview.chromium.org/113873002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus')
-rw-r--r-- | chromeos/dbus/fake_dbus_thread_manager.cc | 25 | ||||
-rw-r--r-- | chromeos/dbus/fake_dbus_thread_manager.h | 3 |
2 files changed, 18 insertions, 10 deletions
diff --git a/chromeos/dbus/fake_dbus_thread_manager.cc b/chromeos/dbus/fake_dbus_thread_manager.cc index 3dfffef..a57a7c2 100644 --- a/chromeos/dbus/fake_dbus_thread_manager.cc +++ b/chromeos/dbus/fake_dbus_thread_manager.cc @@ -69,16 +69,8 @@ void FakeDBusThreadManager::SetFakeClients() { SetCryptohomeClient(scoped_ptr<CryptohomeClient>(new FakeCryptohomeClient)); SetDebugDaemonClient( scoped_ptr<DebugDaemonClient>(new FakeDebugDaemonClient)); - SetShillManagerClient( - scoped_ptr<ShillManagerClient>(new FakeShillManagerClient)); - SetShillDeviceClient( - scoped_ptr<ShillDeviceClient>(new FakeShillDeviceClient)); - SetShillIPConfigClient( - scoped_ptr<ShillIPConfigClient>(new FakeShillIPConfigClient)); - SetShillServiceClient( - scoped_ptr<ShillServiceClient>(new FakeShillServiceClient)); - SetShillProfileClient( - scoped_ptr<ShillProfileClient>(new FakeShillProfileClient)); + + SetFakeShillClients(); FakeGsmSMSClient* gsm_sms_client = new FakeGsmSMSClient(); gsm_sms_client->set_sms_test_message_switch_present( @@ -112,6 +104,19 @@ void FakeDBusThreadManager::SetFakeClients() { SetPowerPolicyController(make_scoped_ptr(new PowerPolicyController)); } +void FakeDBusThreadManager::SetFakeShillClients() { + SetShillManagerClient( + scoped_ptr<ShillManagerClient>(new FakeShillManagerClient)); + SetShillDeviceClient( + scoped_ptr<ShillDeviceClient>(new FakeShillDeviceClient)); + SetShillIPConfigClient( + scoped_ptr<ShillIPConfigClient>(new FakeShillIPConfigClient)); + SetShillServiceClient( + scoped_ptr<ShillServiceClient>(new FakeShillServiceClient)); + SetShillProfileClient( + scoped_ptr<ShillProfileClient>(new FakeShillProfileClient)); +} + void FakeDBusThreadManager::SetBluetoothAdapterClient( scoped_ptr<BluetoothAdapterClient> client) { bluetooth_adapter_client_ = client.Pass(); diff --git a/chromeos/dbus/fake_dbus_thread_manager.h b/chromeos/dbus/fake_dbus_thread_manager.h index ace5690a..b541ffb 100644 --- a/chromeos/dbus/fake_dbus_thread_manager.h +++ b/chromeos/dbus/fake_dbus_thread_manager.h @@ -31,6 +31,9 @@ class CHROMEOS_EXPORT FakeDBusThreadManager : public DBusThreadManager { // Creates and sets all fake DBusClients and the PowerPolicyController. void SetFakeClients(); + // Creates and sets all fake Shill DBusClients. + void SetFakeShillClients(); + void SetBluetoothAdapterClient(scoped_ptr<BluetoothAdapterClient> client); void SetBluetoothAgentManagerClient( scoped_ptr<BluetoothAgentManagerClient> client); |