summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/fake_cros_disks_client.h
diff options
context:
space:
mode:
authorbenchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-06 03:36:15 +0000
committerbenchan@chromium.org <benchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-06 03:36:15 +0000
commita0278d5c56cff22c72528b93710332d50537e6d6 (patch)
tree7a283ff05888f49504ad362124460e5060ffadfd /chromeos/dbus/fake_cros_disks_client.h
parentbf7c7af79138bcc679191cc4fd5d7356ad2917d9 (diff)
downloadchromium_src-a0278d5c56cff22c72528b93710332d50537e6d6.zip
chromium_src-a0278d5c56cff22c72528b93710332d50537e6d6.tar.gz
chromium_src-a0278d5c56cff22c72528b93710332d50537e6d6.tar.bz2
Observe cros-disks FormatCompleted signal instead of FormattingFinished.
The FormattingFinished signal has been long deprecated (back in 2011) and replaced by the FormatCompleted signal, which allows cros-disks to properly notify Chrome the completion of a format operation with an appropriate error code. This CL modifies CrosDisksClient and DiskMountManager to use the FormatCompleted signal. BUG=369877 TEST=Tested the following: 1. Run chromeos_unittests. 2. Insert a USB drive and format the mounted partition via Files.app. Verify that Files.app notifies the successful completion of the format operation. 3. Insert a write-protected SD card and format the mounted partition via Files.app. Verify that Files.app reports an error. R=stevenjb@chromium.org, tbarzic@chromium.org Review URL: https://codereview.chromium.org/266143002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268398 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/fake_cros_disks_client.h')
-rw-r--r--chromeos/dbus/fake_cros_disks_client.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/chromeos/dbus/fake_cros_disks_client.h b/chromeos/dbus/fake_cros_disks_client.h
index 855a3c1..f51a4be 100644
--- a/chromeos/dbus/fake_cros_disks_client.h
+++ b/chromeos/dbus/fake_cros_disks_client.h
@@ -41,17 +41,23 @@ class FakeCrosDisksClient : public CrosDisksClient {
const std::string& device_path,
const GetDevicePropertiesCallback& callback,
const base::Closure& error_callback) OVERRIDE;
- virtual void SetUpConnections(
- const MountEventHandler& mount_event_handler,
+ virtual void SetMountEventHandler(
+ const MountEventHandler& mount_event_handler) OVERRIDE;
+ virtual void SetMountCompletedHandler(
const MountCompletedHandler& mount_completed_handler) OVERRIDE;
+ virtual void SetFormatCompletedHandler(
+ const FormatCompletedHandler& format_completed_handler) OVERRIDE;
// Used in tests to simulate signals sent by cros disks layer.
- // Invokes handlers set in |SetUpConnections|.
+ // Invokes handlers set in |SetMountEventHandler|, |SetMountCompletedHandler|,
+ // and |SetFormatCompletedHandler|.
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);
+ bool SendFormatCompletedEvent(FormatError error_code,
+ const std::string& device_path);
// Returns how many times Unmount() was called.
int unmount_call_count() const {
@@ -105,6 +111,7 @@ class FakeCrosDisksClient : public CrosDisksClient {
private:
MountEventHandler mount_event_handler_;
MountCompletedHandler mount_completed_handler_;
+ FormatCompletedHandler format_completed_handler_;
int unmount_call_count_;
std::string last_unmount_device_path_;