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

Unified Diff: chromeos/dbus/mock_cros_disks_client.h

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/cros_disks_client.cc ('k') | chromeos/dbus/mock_cros_disks_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/mock_cros_disks_client.h
diff --git a/chromeos/dbus/mock_cros_disks_client.h b/chromeos/dbus/mock_cros_disks_client.h
index 9b594001d282bdce57dc51e12328dfeb930b2900..c239fc89b83b12d1bce4f6413b63569207fa5955 100644
--- a/chromeos/dbus/mock_cros_disks_client.h
+++ b/chromeos/dbus/mock_cros_disks_client.h
@@ -37,8 +37,28 @@ class MockCrosDisksClient : public CrosDisksClient {
MOCK_METHOD3(GetDeviceProperties, void(const std::string&,
const GetDevicePropertiesCallback&,
const ErrorCallback&));
+ // Warning: if this method is mocked, SendMountEvent and
+ // SendMountCompletedEvent may not work.
MOCK_METHOD2(SetUpConnections, void(const MountEventHandler&,
const MountCompletedHandler&));
+
+ // Used to simulate signals sent by cros disks layer.
+ // Invokes handlers set in |SetUpConnections|.
+ bool SendMountEvent(MountEventType event, const std::string& path);
+ bool SendMountCompletedEvent(MountError error_code,
+ const std::string& source_path,
+ MountType mount_type,
+ const std::string& mount_path);
+
+ private:
+ // Default implementation of SetupConnections.
+ // Sets internal MounteEvent and MountCompleted handlers.
+ void SetUpConnectionsInternal(
+ const MountEventHandler& mount_event_handler,
+ const MountCompletedHandler& mount_completed_handler);
+
+ MountEventHandler mount_event_handler_;
+ MountCompletedHandler mount_completed_handler_;
};
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/cros_disks_client.cc ('k') | chromeos/dbus/mock_cros_disks_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698