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

Unified Diff: chrome/browser/extensions/api/image_writer_private/test_utils.h

Issue 282853003: Unmounts volumes before writing to a drive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds compile guard to Chrome OS includes in test_utils.h Created 6 years, 7 months 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
Index: chrome/browser/extensions/api/image_writer_private/test_utils.h
diff --git a/chrome/browser/extensions/api/image_writer_private/test_utils.h b/chrome/browser/extensions/api/image_writer_private/test_utils.h
index 00c32135b3c93749375fef4760d5c56b4946c995..80399f66d61ef8ea54d711a6ca661ae072971781 100644
--- a/chrome/browser/extensions/api/image_writer_private/test_utils.h
+++ b/chrome/browser/extensions/api/image_writer_private/test_utils.h
@@ -16,6 +16,11 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_CHROMEOS)
+#include "chromeos/disks/disk_mount_manager.h"
+#include "chromeos/disks/mock_disk_mount_manager.h"
+#endif
+
namespace extensions {
namespace image_writer {
@@ -49,6 +54,37 @@ class MockOperationManager : public OperationManager {
const std::string& error_message));
};
+#if defined(OS_CHROMEOS)
+// A fake for the DiskMountManager that will successfully call the unmount
+// callback.
+class FakeDiskMountManager : public chromeos::disks::MockDiskMountManager {
+ public:
+ FakeDiskMountManager();
+ virtual ~FakeDiskMountManager();
+
+ virtual void UnmountDeviceRecursively(
+ const std::string& device_path,
+ const UnmountDeviceRecursivelyCallbackType& callback) OVERRIDE;
+ /*
+ MOCK_METHOD1(AddObserver, void(chromeos::disks::DiskMountManager::Observer*));
+ MOCK_METHOD1(RemoveObserver,
+ void(chromeos::disks::DiskMountManager::Observer*));
+ MOCK_CONST_METHOD0(disks, const DiskMap&());
+ MOCK_CONST_METHOD1(FindDiskBySourcePath, const Disk*(const std::string&));
+ MOCK_CONST_METHOD0(mount_points, const MountPointMap&());
+ MOCK_METHOD0(RequestMountInfoRefresh, void());
+ MOCK_METHOD4(MountPath, void(const std::string&, const std::string&, const
+ std::string&, chromeos::MountType));
+ MOCK_METHOD3(UnmountPath, void(const std::string&, chromeos::UnmountOptions,
+ const UnmountPathCallback&));
+ MOCK_METHOD1(FormatMountedDevice, void(const std::string&));
+ */
+
+ private:
+ DiskMap disks_;
+};
+#endif
+
class FakeImageWriterClient : public ImageWriterUtilityClient {
public:
FakeImageWriterClient();

Powered by Google App Engine
This is Rietveld 408576698