| OLD | NEW |
| 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 #include "chromeos/disks/mock_disk_mount_manager.h" | 5 #include "chromeos/disks/mock_disk_mount_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 .Times(AnyNumber()); | 176 .Times(AnyNumber()); |
| 177 EXPECT_CALL(*this, FormatMountedDevice(_)) | 177 EXPECT_CALL(*this, FormatMountedDevice(_)) |
| 178 .Times(AnyNumber()); | 178 .Times(AnyNumber()); |
| 179 EXPECT_CALL(*this, UnmountDeviceRecursive(_, _, _)) | 179 EXPECT_CALL(*this, UnmountDeviceRecursive(_, _, _)) |
| 180 .Times(AnyNumber()); | 180 .Times(AnyNumber()); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void MockDiskMountManager::CreateDiskEntryForMountDevice( | 183 void MockDiskMountManager::CreateDiskEntryForMountDevice( |
| 184 const DiskMountManager::MountPointInfo& mount_info, | 184 const DiskMountManager::MountPointInfo& mount_info, |
| 185 const std::string& device_id, | 185 const std::string& device_id, |
| 186 const std::string& device_label) { | 186 const std::string& device_label, |
| 187 const std::string& vendor_name, |
| 188 const std::string& product_name, |
| 189 DeviceType device_type, |
| 190 uint64 total_size_in_bytes) { |
| 187 Disk* disk = new DiskMountManager::Disk(std::string(mount_info.source_path), | 191 Disk* disk = new DiskMountManager::Disk(std::string(mount_info.source_path), |
| 188 std::string(mount_info.mount_path), | 192 std::string(mount_info.mount_path), |
| 189 std::string(), // system_path | 193 std::string(), // system_path |
| 190 std::string(), // file_path | 194 std::string(), // file_path |
| 191 device_label, // device_label | 195 device_label, // device_label |
| 192 std::string(), // drive_label | 196 std::string(), // drive_label |
| 193 std::string(), // vendor_id | 197 std::string(), // vendor_id |
| 194 std::string(), // vendor_name | 198 vendor_name, |
| 195 std::string(), // product_id | 199 std::string(), // product_id |
| 196 std::string(), // product_name | 200 product_name, |
| 197 device_id, // fs_uuid | 201 device_id, // fs_uuid |
| 198 std::string(), // system_path_prefix | 202 std::string(), // system_path_prefix |
| 199 DEVICE_TYPE_USB, // device_type | 203 device_type, |
| 200 1073741824, // total_size_in_bytes | 204 total_size_in_bytes, |
| 201 false, // is_parent | 205 false, // is_parent |
| 202 false, // is_read_only | 206 false, // is_read_only |
| 203 true, // has_media | 207 true, // has_media |
| 204 false, // on_boot_device | 208 false, // on_boot_device |
| 205 false); // is_hidden | 209 false); // is_hidden |
| 206 DiskMountManager::DiskMap::iterator it = disks_.find(mount_info.source_path); | 210 DiskMountManager::DiskMap::iterator it = disks_.find(mount_info.source_path); |
| 207 if (it == disks_.end()) { | 211 if (it == disks_.end()) { |
| 208 disks_.insert(std::make_pair(std::string(mount_info.source_path), disk)); | 212 disks_.insert(std::make_pair(std::string(mount_info.source_path), disk)); |
| 209 } else { | 213 } else { |
| 210 delete it->second; | 214 delete it->second; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 239 FOR_EACH_OBSERVER(Observer, observers_, DiskChanged(event, disk)); | 243 FOR_EACH_OBSERVER(Observer, observers_, DiskChanged(event, disk)); |
| 240 } | 244 } |
| 241 | 245 |
| 242 void MockDiskMountManager::NotifyDeviceChanged(DiskMountManagerEventType event, | 246 void MockDiskMountManager::NotifyDeviceChanged(DiskMountManagerEventType event, |
| 243 const std::string& path) { | 247 const std::string& path) { |
| 244 FOR_EACH_OBSERVER(Observer, observers_, DeviceChanged(event, path)); | 248 FOR_EACH_OBSERVER(Observer, observers_, DeviceChanged(event, path)); |
| 245 } | 249 } |
| 246 | 250 |
| 247 } // namespace disks | 251 } // namespace disks |
| 248 } // namespace chromeos | 252 } // namespace chromeos |
| OLD | NEW |