| Index: chromeos/dbus/mock_cros_disks_client.cc
|
| diff --git a/chromeos/dbus/mock_cros_disks_client.cc b/chromeos/dbus/mock_cros_disks_client.cc
|
| index 998c550f9cb56770e9aced1ae68316f0917def9e..c56d1075490e610e8e06d41c7ee7ac9181dc5129 100644
|
| --- a/chromeos/dbus/mock_cros_disks_client.cc
|
| +++ b/chromeos/dbus/mock_cros_disks_client.cc
|
| @@ -4,10 +4,43 @@
|
|
|
| #include "chromeos/dbus/mock_cros_disks_client.h"
|
|
|
| +using testing::_;
|
| +using testing::Invoke;
|
| +
|
| namespace chromeos {
|
|
|
| -MockCrosDisksClient::MockCrosDisksClient() {}
|
| +MockCrosDisksClient::MockCrosDisksClient() {
|
| + ON_CALL(*this, SetUpConnections(_, _))
|
| + .WillByDefault(Invoke(this,
|
| + &MockCrosDisksClient::SetUpConnectionsInternal));
|
| +}
|
|
|
| MockCrosDisksClient::~MockCrosDisksClient() {}
|
|
|
| +bool MockCrosDisksClient::SendMountEvent(MountEventType event,
|
| + const std::string& path) {
|
| + if (mount_event_handler_.is_null())
|
| + return false;
|
| + mount_event_handler_.Run(event, path);
|
| + return true;
|
| +}
|
| +
|
| +bool MockCrosDisksClient::SendMountCompletedEvent(
|
| + MountError error_code,
|
| + const std::string& source_path,
|
| + MountType mount_type,
|
| + const std::string& mount_path) {
|
| + if (mount_completed_handler_.is_null())
|
| + return false;
|
| + mount_completed_handler_.Run(error_code, source_path, mount_type, mount_path);
|
| + return true;
|
| +}
|
| +
|
| +void MockCrosDisksClient::SetUpConnectionsInternal(
|
| + const MountEventHandler& mount_event_handler,
|
| + const MountCompletedHandler& mount_completed_handler) {
|
| + mount_event_handler_ = mount_event_handler;
|
| + mount_completed_handler_ = mount_completed_handler;
|
| +}
|
| +
|
| } // namespace chromeos
|
|
|