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

Unified Diff: chromeos/dbus/mock_cros_disks_client.cc

Issue 11365142: Small refactoring in DiskMountManager (event reporting; format method). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: few lint nits Created 8 years, 1 month 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_cros_disks_client.h ('k') | chromeos/disks/disk_mount_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chromeos/dbus/mock_cros_disks_client.h ('k') | chromeos/disks/disk_mount_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698