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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_
6 #define CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_ 6 #define CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chromeos/dbus/cros_disks_client.h" 10 #include "chromeos/dbus/cros_disks_client.h"
(...skipping 19 matching lines...) Expand all
30 MOCK_METHOD2(EnumerateAutoMountableDevices, 30 MOCK_METHOD2(EnumerateAutoMountableDevices,
31 void(const EnumerateAutoMountableDevicesCallback&, 31 void(const EnumerateAutoMountableDevicesCallback&,
32 const ErrorCallback&)); 32 const ErrorCallback&));
33 MOCK_METHOD4(FormatDevice, void(const std::string&, 33 MOCK_METHOD4(FormatDevice, void(const std::string&,
34 const std::string&, 34 const std::string&,
35 const FormatDeviceCallback&, 35 const FormatDeviceCallback&,
36 const ErrorCallback&)); 36 const ErrorCallback&));
37 MOCK_METHOD3(GetDeviceProperties, void(const std::string&, 37 MOCK_METHOD3(GetDeviceProperties, void(const std::string&,
38 const GetDevicePropertiesCallback&, 38 const GetDevicePropertiesCallback&,
39 const ErrorCallback&)); 39 const ErrorCallback&));
40 // Warning: if this method is mocked, SendMountEvent and
41 // SendMountCompletedEvent may not work.
40 MOCK_METHOD2(SetUpConnections, void(const MountEventHandler&, 42 MOCK_METHOD2(SetUpConnections, void(const MountEventHandler&,
41 const MountCompletedHandler&)); 43 const MountCompletedHandler&));
44
45 // Used to simulate signals sent by cros disks layer.
46 // Invokes handlers set in |SetUpConnections|.
47 bool SendMountEvent(MountEventType event, const std::string& path);
48 bool SendMountCompletedEvent(MountError error_code,
49 const std::string& source_path,
50 MountType mount_type,
51 const std::string& mount_path);
52
53 private:
54 // Default implementation of SetupConnections.
55 // Sets internal MounteEvent and MountCompleted handlers.
56 void SetUpConnectionsInternal(
57 const MountEventHandler& mount_event_handler,
58 const MountCompletedHandler& mount_completed_handler);
59
60 MountEventHandler mount_event_handler_;
61 MountCompletedHandler mount_completed_handler_;
42 }; 62 };
43 63
44 } // namespace chromeos 64 } // namespace chromeos
45 65
46 #endif // CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_ 66 #endif // CHROMEOS_DBUS_MOCK_CROS_DISKS_CLIENT_H_
OLDNEW
« 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