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

Unified Diff: chrome/browser/chromeos/disks/mock_disk_mount_manager.cc

Issue 10829160: Created a helper function "FindDiskBySourcePath" in DiskMountManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
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 38909657826ee68caf25758e787c844d03f82fc9..de08ebed8e0311b8d95bb1c59bcc6e8e04d1c272 100644
--- a/chrome/browser/chromeos/disks/mock_disk_mount_manager.cc
+++ b/chrome/browser/chromeos/disks/mock_disk_mount_manager.cc
@@ -53,6 +53,9 @@ MockDiskMountManager::MockDiskMountManager() {
.WillByDefault(Invoke(this, &MockDiskMountManager::disksInternal));
ON_CALL(*this, mount_points())
.WillByDefault(Invoke(this, &MockDiskMountManager::mountPointsInternal));
+ ON_CALL(*this, FindDiskBySourcePath(_))
+ .WillByDefault(Invoke(
+ this, &MockDiskMountManager::FindDiskBySourcePathInternal));
}
MockDiskMountManager::~MockDiskMountManager() {
@@ -147,6 +150,8 @@ void MockDiskMountManager::SetupDefaultReplies() {
.WillRepeatedly(ReturnRef(disks_));
EXPECT_CALL(*this, mount_points())
.WillRepeatedly(ReturnRef(mount_points_));
+ EXPECT_CALL(*this, FindDiskBySourcePath(_))
+ .Times(AnyNumber());
EXPECT_CALL(*this, RequestMountInfoRefresh())
.Times(AnyNumber());
EXPECT_CALL(*this, MountPath(_, _, _, _))
@@ -202,6 +207,13 @@ MockDiskMountManager::mountPointsInternal() const {
return mount_points_;
}
+const DiskMountManager::Disk*
+MockDiskMountManager::FindDiskBySourcePathInternal(
+ const std::string& source_path) const {
+ DiskMap::const_iterator disk_it = disks_.find(source_path);
+ return disk_it == disks_.end() ? NULL : disk_it->second;
+}
+
void MockDiskMountManager::NotifyDiskChanged(
DiskMountManagerEventType event,
const DiskMountManager::Disk* disk) {

Powered by Google App Engine
This is Rietveld 408576698