| Index: chrome/browser/chromeos/disks/mock_disk_mount_manager.cc
|
| diff --git a/chrome/browser/chromeos/disks/mock_disk_mount_manager.cc b/chrome/browser/chromeos/disks/mock_disk_mount_manager.cc
|
| index 80558e0dc797bba5c9dd382535405c65f5c66720..4291298c203dd15e4d092fc535cf4d3c350ba570 100644
|
| --- a/chrome/browser/chromeos/disks/mock_disk_mount_manager.cc
|
| +++ b/chrome/browser/chromeos/disks/mock_disk_mount_manager.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/chromeos/disks/mock_disk_mount_manager.h"
|
|
|
| #include "base/message_loop.h"
|
| +#include "base/stl_util.h"
|
| #include "base/string_util.h"
|
| #include "content/public/browser/browser_thread.h"
|
|
|
| @@ -26,6 +27,7 @@ const char* kTestMountPath = "/media/foofoo";
|
| const char* kTestFilePath = "/this/file/path";
|
| const char* kTestDeviceLabel = "A label";
|
| const char* kTestDriveLabel = "Another label";
|
| +const char* kTestUuid = "FFFF-FFFF";
|
|
|
| } // namespace
|
|
|
| @@ -50,6 +52,8 @@ MockDiskMountManager::MockDiskMountManager() {
|
| }
|
|
|
| MockDiskMountManager::~MockDiskMountManager() {
|
| + STLDeleteContainerPairSecondPointers(disks_.begin(), disks_.end());
|
| + disks_.clear();
|
| }
|
|
|
| void MockDiskMountManager::NotifyDeviceInsertEvents() {
|
| @@ -60,6 +64,7 @@ void MockDiskMountManager::NotifyDeviceInsertEvents() {
|
| std::string(kTestFilePath),
|
| std::string(),
|
| std::string(kTestDriveLabel),
|
| + std::string(kTestUuid),
|
| std::string(kTestSystemPathPrefix),
|
| DEVICE_TYPE_USB,
|
| 4294967295U,
|
| @@ -90,6 +95,7 @@ void MockDiskMountManager::NotifyDeviceInsertEvents() {
|
| std::string(kTestFilePath),
|
| std::string(kTestDeviceLabel),
|
| std::string(kTestDriveLabel),
|
| + std::string(kTestUuid),
|
| std::string(kTestSystemPathPrefix),
|
| DEVICE_TYPE_MOBILE,
|
| 1073741824,
|
| @@ -113,6 +119,7 @@ void MockDiskMountManager::NotifyDeviceRemoveEvents() {
|
| std::string(kTestFilePath),
|
| std::string(kTestDeviceLabel),
|
| std::string(kTestDriveLabel),
|
| + std::string(kTestUuid),
|
| std::string(kTestSystemPathPrefix),
|
| DEVICE_TYPE_SD,
|
| 1073741824,
|
| @@ -148,6 +155,37 @@ void MockDiskMountManager::SetupDefaultReplies() {
|
| .Times(AnyNumber());
|
| }
|
|
|
| +void MockDiskMountManager::CreateDiskEntryForMountDevice(
|
| + const DiskMountManager::MountPointInfo& mount_info,
|
| + const std::string& device_id) {
|
| + Disk* disk = new DiskMountManager::Disk(std::string(mount_info.source_path),
|
| + std::string(mount_info.mount_path),
|
| + std::string(), // system_path
|
| + std::string(), // file_path
|
| + std::string(), // device_label
|
| + std::string(), // drive_label
|
| + device_id, // fs_uuid
|
| + std::string(), // system_path_prefix
|
| + DEVICE_TYPE_USB, // device_type
|
| + 1073741824, // total_size_in_bytes
|
| + false, // is_parent
|
| + false, // is_read_only
|
| + true, // has_media
|
| + false, // on_boot_device
|
| + false); // is_hidden
|
| + disks_.insert(std::pair<std::string, DiskMountManager::Disk*>(
|
| + std::string(mount_info.source_path), disk));
|
| +}
|
| +
|
| +void MockDiskMountManager::RemoveDiskEntryForMountDevice(
|
| + const DiskMountManager::MountPointInfo& mount_info) {
|
| + DiskMountManager::DiskMap::iterator it = disks_.find(mount_info.source_path);
|
| + if (it != disks_.end()) {
|
| + delete it->second;
|
| + disks_.erase(it);
|
| + }
|
| +}
|
| +
|
| void MockDiskMountManager::NotifyDiskChanged(DiskMountManagerEventType event,
|
| const DiskMountManager::Disk* disk)
|
| {
|
|
|