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) { | |
191 Disk* disk = new DiskMountManager::Disk(std::string(mount_info.source_path), | 187 Disk* disk = new DiskMountManager::Disk(std::string(mount_info.source_path), |
192 std::string(mount_info.mount_path), | 188 std::string(mount_info.mount_path), |
193 std::string(), // system_path | 189 std::string(), // system_path |
194 std::string(), // file_path | 190 std::string(), // file_path |
195 device_label, // device_label | 191 device_label, // device_label |
196 std::string(), // drive_label | 192 std::string(), // drive_label |
197 std::string(), // vendor_id | 193 std::string(), // vendor_id |
198 vendor_name, | 194 std::string(), // vendor_name |
199 std::string(), // product_id | 195 std::string(), // product_id |
200 product_name, | 196 std::string(), // product_name |
201 device_id, // fs_uuid | 197 device_id, // fs_uuid |
202 std::string(), // system_path_prefix | 198 std::string(), // system_path_prefix |
203 device_type, | 199 DEVICE_TYPE_USB, // device_type |
204 total_size_in_bytes, | 200 1073741824, // total_size_in_bytes |
205 false, // is_parent | 201 false, // is_parent |
206 false, // is_read_only | 202 false, // is_read_only |
207 true, // has_media | 203 true, // has_media |
208 false, // on_boot_device | 204 false, // on_boot_device |
209 false); // is_hidden | 205 false); // is_hidden |
210 DiskMountManager::DiskMap::iterator it = disks_.find(mount_info.source_path); | 206 DiskMountManager::DiskMap::iterator it = disks_.find(mount_info.source_path); |
211 if (it == disks_.end()) { | 207 if (it == disks_.end()) { |
212 disks_.insert(std::make_pair(std::string(mount_info.source_path), disk)); | 208 disks_.insert(std::make_pair(std::string(mount_info.source_path), disk)); |
213 } else { | 209 } else { |
214 delete it->second; | 210 delete it->second; |
(...skipping 28 matching lines...) Expand all Loading... |
243 FOR_EACH_OBSERVER(Observer, observers_, DiskChanged(event, disk)); | 239 FOR_EACH_OBSERVER(Observer, observers_, DiskChanged(event, disk)); |
244 } | 240 } |
245 | 241 |
246 void MockDiskMountManager::NotifyDeviceChanged(DiskMountManagerEventType event, | 242 void MockDiskMountManager::NotifyDeviceChanged(DiskMountManagerEventType event, |
247 const std::string& path) { | 243 const std::string& path) { |
248 FOR_EACH_OBSERVER(Observer, observers_, DeviceChanged(event, path)); | 244 FOR_EACH_OBSERVER(Observer, observers_, DeviceChanged(event, path)); |
249 } | 245 } |
250 | 246 |
251 } // namespace disks | 247 } // namespace disks |
252 } // namespace chromeos | 248 } // namespace chromeos |
OLD | NEW |