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

Side by Side Diff: chrome/browser/chromeos/cros/mock_mount_library.h

Issue 7457001: Adding support for mount point different from removable devices to MountLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/mock_mount_library.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_CROS_MOCK_MOUNT_LIBRARY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_MOCK_MOUNT_LIBRARY_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_MOUNT_LIBRARY_H_ 6 #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_MOUNT_LIBRARY_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "chrome/browser/chromeos/cros/mount_library.h" 13 #include "chrome/browser/chromeos/cros/mount_library.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "third_party/cros/chromeos_mount.h" 16 #include "third_party/cros/chromeos_mount.h"
17 17
18 namespace chromeos { 18 namespace chromeos {
19 19
20 class MockMountLibrary : public MountLibrary { 20 class MockMountLibrary : public MountLibrary {
21 public: 21 public:
22 MockMountLibrary(); 22 MockMountLibrary();
23 virtual ~MockMountLibrary(); 23 virtual ~MockMountLibrary();
24 24
25 MOCK_METHOD1(AddObserver, void(MountLibrary::Observer*)); 25 MOCK_METHOD1(AddObserver, void(MountLibrary::Observer*));
26 MOCK_METHOD1(RemoveObserver, void(MountLibrary::Observer*)); 26 MOCK_METHOD1(RemoveObserver, void(MountLibrary::Observer*));
27 MOCK_CONST_METHOD0(disks, const MountLibrary::DiskMap&(void)); 27 MOCK_CONST_METHOD0(disks, const MountLibrary::DiskMap&(void));
28 MOCK_CONST_METHOD0(mount_points, const MountLibrary::MountPointMap&(void));
29
30 MOCK_CONST_METHOD1(MountTypeToString, std::string(MountType));
31 MOCK_CONST_METHOD1(MountTypeFromString, MountType(const std::string&));
28 32
29 MOCK_METHOD0(RequestMountInfoRefresh, void(void)); 33 MOCK_METHOD0(RequestMountInfoRefresh, void(void));
30 MOCK_METHOD1(MountPath, void(const char*)); 34 MOCK_METHOD3(MountPath, void(const char*,
35 MountType,
36 const MountPathOptions&));
31 MOCK_METHOD1(UnmountPath, void(const char*)); 37 MOCK_METHOD1(UnmountPath, void(const char*));
32 MOCK_METHOD3(UnmountDeviceRecursive, void(const char*, 38 MOCK_METHOD3(UnmountDeviceRecursive, void(const char*,
33 MountLibrary::UnmountDeviceRecursiveCallbackType, void*)); 39 MountLibrary::UnmountDeviceRecursiveCallbackType, void*));
34 40
35 void FireDeviceInsertEvents(); 41 void FireDeviceInsertEvents();
36 void FireDeviceRemoveEvents(); 42 void FireDeviceRemoveEvents();
37 43
38 void SetupDefaultReplies(); 44 void SetupDefaultReplies();
39 45
40 private: 46 private:
41 void AddObserverInternal(MountLibrary::Observer* observer); 47 void AddObserverInternal(MountLibrary::Observer* observer);
42 void RemoveObserverInternal(MountLibrary::Observer* observer); 48 void RemoveObserverInternal(MountLibrary::Observer* observer);
43 const MountLibrary::DiskMap& disksInternal() const { return disks_; } 49 const MountLibrary::DiskMap& disksInternal() const { return disks_; }
50 const MountLibrary::MountPointMap& mountPointsInternal() const {
51 return mount_points_;
52 }
44 53
45 54
46 void UpdateDeviceChanged(MountLibraryEventType evt, 55 void UpdateDeviceChanged(MountLibraryEventType evt,
47 const std::string& path); 56 const std::string& path);
48 void UpdateDiskChanged(MountLibraryEventType evt, 57 void UpdateDiskChanged(MountLibraryEventType evt,
49 const MountLibrary::Disk* disk); 58 const MountLibrary::Disk* disk);
50 59
51 ObserverList<MountLibrary::Observer> observers_; 60 ObserverList<MountLibrary::Observer> observers_;
52 61
53 // The list of disks found. 62 // The list of disks found.
54 MountLibrary::DiskMap disks_; 63 MountLibrary::DiskMap disks_;
64 MountLibrary::MountPointMap mount_points_;
55 65
56 DISALLOW_COPY_AND_ASSIGN(MockMountLibrary); 66 DISALLOW_COPY_AND_ASSIGN(MockMountLibrary);
57 }; 67 };
58 68
59 } // namespace chromeos 69 } // namespace chromeos
60 70
61 #endif // CHROME_BROWSER_CHROMEOS_CROS_MOCK_MOUNT_LIBRARY_H_ 71 #endif // CHROME_BROWSER_CHROMEOS_CROS_MOCK_MOUNT_LIBRARY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/mock_mount_library.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698