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

Unified Diff: chrome/browser/chromeos/mock_disk_mount_manager.h

Issue 8499007: Add CrosDisksClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split a part of code into disk_mount_manager.cc/h Created 9 years, 1 month 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/mock_disk_mount_manager.h
diff --git a/chrome/browser/chromeos/mock_disk_mount_manager.h b/chrome/browser/chromeos/mock_disk_mount_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..0573a908a48cb1dec184ec5309edd21aa73f89ec
--- /dev/null
+++ b/chrome/browser/chromeos/mock_disk_mount_manager.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_MOCK_DISK_MOUNT_MANAGER_H_
+#define CHROME_BROWSER_CHROMEOS_MOCK_DISK_MOUNT_MANAGER_H_
+#pragma once
+
+#include <string>
+
+#include "base/observer_list.h"
+#include "base/time.h"
+#include "chrome/browser/chromeos/disk_mount_manager.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromeos {
+
+class MockDiskMountManager : public DiskMountManager {
+ public:
+ MockDiskMountManager();
+ virtual ~MockDiskMountManager();
+
+ MOCK_METHOD0(Init, void(void));
+ MOCK_METHOD1(AddObserver, void(DiskMountManager::Observer*));
+ MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*));
+ MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void));
+ MOCK_CONST_METHOD0(mount_points,
+ const DiskMountManager::MountPointMap&(void));
+ MOCK_METHOD0(RequestMountInfoRefresh, void(void));
+ MOCK_METHOD2(MountPath, void(const std::string&, MountType));
+ MOCK_METHOD1(UnmountPath, void(const std::string&));
+ MOCK_METHOD3(GetSizeStatsOnFileThread, void(const std::string&, size_t*,
+ size_t*));
+ MOCK_METHOD1(FormatUnmountedDevice, void(const std::string&));
+ MOCK_METHOD1(FormatMountedDevice, void(const std::string&));
+ MOCK_METHOD3(UnmountDeviceRecursive, void(const std::string&,
+ DiskMountManager::UnmountDeviceRecursiveCallbackType, void*));
+
+ void FireDeviceInsertEvents();
satorux1 2011/11/11 00:43:55 Fire -> Notify. Please add a function comment.
hashimoto 2011/11/11 08:00:53 Done.
+ void FireDeviceRemoveEvents();
+
+ void SetupDefaultReplies();
+
+ private:
+ void AddObserverInternal(DiskMountManager::Observer* observer);
satorux1 2011/11/11 00:43:55 function comment
hashimoto 2011/11/11 08:00:53 Done.
+ void RemoveObserverInternal(DiskMountManager::Observer* observer);
+ const DiskMountManager::DiskMap& disksInternal() const { return disks_; }
+
+
+ void UpdateDeviceChanged(DiskMountManagerEventType evt,
+ const std::string& path);
+ void UpdateDiskChanged(DiskMountManagerEventType evt,
+ const DiskMountManager::Disk* disk);
+
+ ObserverList<DiskMountManager::Observer> observers_;
+
+ // The list of disks found.
+ DiskMountManager::DiskMap disks_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_MOCK_DISK_MOUNT_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698