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

Side by Side Diff: chromeos/disks/mock_disk_mount_manager.h

Issue 207383004: Adds a new removable storage provider for imageWriterPrivate on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small formatting update. Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chromeos/disks/mock_disk_mount_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ 5 #ifndef CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_
6 #define CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ 6 #define CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
11 #include "chromeos/dbus/cros_disks_client.h" 11 #include "chromeos/dbus/cros_disks_client.h"
12 #include "chromeos/disks/disk_mount_manager.h" 12 #include "chromeos/disks/disk_mount_manager.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace chromeos { 16 namespace chromeos {
17 namespace disks { 17 namespace disks {
18 18
19 // TODO(tbarzic): Replace this mock with a fake implementation
20 // (http://crbug.com/355757)
19 class MockDiskMountManager : public DiskMountManager { 21 class MockDiskMountManager : public DiskMountManager {
20 public: 22 public:
21 MockDiskMountManager(); 23 MockDiskMountManager();
22 virtual ~MockDiskMountManager(); 24 virtual ~MockDiskMountManager();
23 25
24 // DiskMountManager override. 26 // DiskMountManager override.
25 MOCK_METHOD0(Init, void(void)); 27 MOCK_METHOD0(Init, void(void));
26 MOCK_METHOD1(AddObserver, void(DiskMountManager::Observer*)); 28 MOCK_METHOD1(AddObserver, void(DiskMountManager::Observer*));
27 MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*)); 29 MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*));
28 MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void)); 30 MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void));
(...skipping 24 matching lines...) Expand all
53 55
54 // Creates a fake disk entry for the mounted device. This function is 56 // Creates a fake disk entry for the mounted device. This function is
55 // primarily for StorageMonitorTest. 57 // primarily for StorageMonitorTest.
56 void CreateDiskEntryForMountDevice( 58 void CreateDiskEntryForMountDevice(
57 const DiskMountManager::MountPointInfo& mount_info, 59 const DiskMountManager::MountPointInfo& mount_info,
58 const std::string& device_id, 60 const std::string& device_id,
59 const std::string& device_label, 61 const std::string& device_label,
60 const std::string& vendor_name, 62 const std::string& vendor_name,
61 const std::string& product_name, 63 const std::string& product_name,
62 DeviceType device_type, 64 DeviceType device_type,
63 uint64 total_size_in_bytes); 65 uint64 total_size_in_bytes,
66 bool is_parent,
67 bool has_media,
68 bool on_boot_device);
64 69
65 // Removes the fake disk entry associated with the mounted device. This 70 // Removes the fake disk entry associated with the mounted device. This
66 // function is primarily for StorageMonitorTest. 71 // function is primarily for StorageMonitorTest.
67 void RemoveDiskEntryForMountDevice( 72 void RemoveDiskEntryForMountDevice(
68 const DiskMountManager::MountPointInfo& mount_info); 73 const DiskMountManager::MountPointInfo& mount_info);
69 74
70 private: 75 private:
71 // Is used to implement AddObserver. 76 // Is used to implement AddObserver.
72 void AddObserverInternal(DiskMountManager::Observer* observer); 77 void AddObserverInternal(DiskMountManager::Observer* observer);
73 78
(...skipping 26 matching lines...) Expand all
100 // The list of existing mount points. 105 // The list of existing mount points.
101 DiskMountManager::MountPointMap mount_points_; 106 DiskMountManager::MountPointMap mount_points_;
102 107
103 DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager); 108 DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager);
104 }; 109 };
105 110
106 } // namespace disks 111 } // namespace disks
107 } // namespace chromeos 112 } // namespace chromeos
108 113
109 #endif // CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ 114 #endif // CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chromeos/disks/mock_disk_mount_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698