| 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 #ifndef CHROME_BROWSER_CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ | 5 #ifndef CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ |
| 6 #define CHROME_BROWSER_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 "base/time.h" | 11 #include "base/time.h" |
| 12 #include "chrome/browser/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 class MockDiskMountManager : public DiskMountManager { | 19 class MockDiskMountManager : public DiskMountManager { |
| 20 public: | 20 public: |
| 21 MockDiskMountManager(); | 21 MockDiskMountManager(); |
| 22 virtual ~MockDiskMountManager(); | 22 virtual ~MockDiskMountManager(); |
| 23 | 23 |
| 24 // DiskMountManager override. | 24 // DiskMountManager override. |
| 25 MOCK_METHOD0(Init, void(void)); | 25 MOCK_METHOD0(Init, void(void)); |
| 26 MOCK_METHOD1(AddObserver, void(DiskMountManager::Observer*)); | 26 MOCK_METHOD1(AddObserver, void(DiskMountManager::Observer*)); |
| 27 MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*)); | 27 MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*)); |
| 28 MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void)); | 28 MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void)); |
| 29 MOCK_CONST_METHOD1(FindDiskBySourcePath, | 29 MOCK_CONST_METHOD1(FindDiskBySourcePath, |
| 30 const DiskMountManager::Disk*(const std::string&)); | 30 const DiskMountManager::Disk*(const std::string&)); |
| 31 MOCK_CONST_METHOD0(mount_points, | 31 MOCK_CONST_METHOD0(mount_points, |
| 32 const DiskMountManager::MountPointMap&(void)); | 32 const DiskMountManager::MountPointMap&(void)); |
| 33 MOCK_METHOD0(RequestMountInfoRefresh, void(void)); | 33 MOCK_METHOD0(RequestMountInfoRefresh, void(void)); |
| 34 MOCK_METHOD4(MountPath, void(const std::string&, const std::string&, | 34 MOCK_METHOD4(MountPath, void(const std::string&, const std::string&, |
| 35 const std::string&, MountType)); | 35 const std::string&, MountType)); |
| 36 MOCK_METHOD1(UnmountPath, void(const std::string&)); | 36 MOCK_METHOD1(UnmountPath, void(const std::string&)); |
| 37 MOCK_METHOD3(GetSizeStatsOnFileThread, void(const std::string&, size_t*, | |
| 38 size_t*)); | |
| 39 MOCK_METHOD1(FormatUnmountedDevice, void(const std::string&)); | 37 MOCK_METHOD1(FormatUnmountedDevice, void(const std::string&)); |
| 40 MOCK_METHOD1(FormatMountedDevice, void(const std::string&)); | 38 MOCK_METHOD1(FormatMountedDevice, void(const std::string&)); |
| 41 MOCK_METHOD3(UnmountDeviceRecursive, void(const std::string&, | 39 MOCK_METHOD3(UnmountDeviceRecursive, void(const std::string&, |
| 42 DiskMountManager::UnmountDeviceRecursiveCallbackType, void*)); | 40 DiskMountManager::UnmountDeviceRecursiveCallbackType, void*)); |
| 43 | 41 |
| 44 // Invokes fake device insert events. | 42 // Invokes fake device insert events. |
| 45 void NotifyDeviceInsertEvents(); | 43 void NotifyDeviceInsertEvents(); |
| 46 | 44 |
| 47 // Invokes fake device remove events. | 45 // Invokes fake device remove events. |
| 48 void NotifyDeviceRemoveEvents(); | 46 void NotifyDeviceRemoveEvents(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 91 |
| 94 // The list of existing mount points. | 92 // The list of existing mount points. |
| 95 DiskMountManager::MountPointMap mount_points_; | 93 DiskMountManager::MountPointMap mount_points_; |
| 96 | 94 |
| 97 DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager); | 95 DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager); |
| 98 }; | 96 }; |
| 99 | 97 |
| 100 } // namespace disks | 98 } // namespace disks |
| 101 } // namespace chromeos | 99 } // namespace chromeos |
| 102 | 100 |
| 103 #endif // CHROME_BROWSER_CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ | 101 #endif // CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ |
| OLD | NEW |