OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_FILE_SYSTEM_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_FILE_SYSTEM_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "chrome/browser/chromeos/drive/file_system_interface.h" | |
11 #include "testing/gmock/include/gmock/gmock.h" | |
12 | |
13 namespace drive { | |
14 | |
15 class FileSystemObserver; | |
16 | |
17 // Mock for FileSystemInterface. | |
18 class MockFileSystem : public FileSystemInterface { | |
19 public: | |
20 MockFileSystem(); | |
21 virtual ~MockFileSystem(); | |
22 | |
23 // FileSystemInterface overrides. | |
24 MOCK_METHOD0(Initialize, void()); | |
25 MOCK_METHOD1(AddObserver, void(FileSystemObserver* observer)); | |
26 MOCK_METHOD1(RemoveObserver, | |
27 void(FileSystemObserver* observer)); | |
28 MOCK_METHOD0(CheckForUpdates, void()); | |
29 MOCK_METHOD2(GetResourceEntryById, | |
30 void(const std::string& resource_id, | |
31 const GetResourceEntryCallback& callback)); | |
32 MOCK_METHOD3(Search, void(const std::string& search_query, | |
33 const GURL& next_url, | |
34 const SearchCallback& callback)); | |
35 MOCK_METHOD4(SearchMetadata, void(const std::string& query, | |
36 int options, | |
37 int at_most_num_matches, | |
38 const SearchMetadataCallback& callback)); | |
39 MOCK_METHOD3(TransferFileFromRemoteToLocal, | |
40 void(const base::FilePath& local_src_file_path, | |
41 const base::FilePath& remote_dest_file_path, | |
42 const FileOperationCallback& callback)); | |
43 MOCK_METHOD3(TransferFileFromLocalToRemote, | |
44 void(const base::FilePath& local_src_file_path, | |
45 const base::FilePath& remote_dest_file_path, | |
46 const FileOperationCallback& callback)); | |
47 MOCK_METHOD2(OpenFile, void(const base::FilePath& file_path, | |
48 const OpenFileCallback& callback)); | |
49 MOCK_METHOD2(CloseFile, void(const base::FilePath& file_path, | |
50 const FileOperationCallback& callback)); | |
51 MOCK_METHOD3(Copy, void(const base::FilePath& src_file_path, | |
52 const base::FilePath& dest_file_path, | |
53 const FileOperationCallback& callback)); | |
54 MOCK_METHOD3(Move, void(const base::FilePath& src_file_path, | |
55 const base::FilePath& dest_file_path, | |
56 const FileOperationCallback& callback)); | |
57 MOCK_METHOD3(Remove, void(const base::FilePath& file_path, | |
58 bool is_recursive, | |
59 const FileOperationCallback& callback)); | |
60 MOCK_METHOD4(CreateDirectory, | |
61 void(const base::FilePath& directory_path, | |
62 bool is_exclusive, | |
63 bool is_recursive, | |
64 const FileOperationCallback& callback)); | |
65 MOCK_METHOD3(CreateFile, | |
66 void(const base::FilePath& file_path, | |
67 bool is_exclusive, | |
68 const FileOperationCallback& callback)); | |
69 MOCK_METHOD4(TouchFile, | |
70 void(const base::FilePath& file_path, | |
71 const base::Time& last_access_time, | |
72 const base::Time& last_modified_time, | |
73 const FileOperationCallback& callback)); | |
74 MOCK_METHOD2(Pin, void(const base::FilePath& file_path, | |
75 const FileOperationCallback& callback)); | |
76 MOCK_METHOD2(Unpin, void(const base::FilePath& file_path, | |
77 const FileOperationCallback& callback)); | |
78 MOCK_METHOD2(GetFileByPath, | |
79 void(const base::FilePath& file_path, | |
80 const GetFileCallback& callback)); | |
81 MOCK_METHOD4( | |
82 GetFileByResourceId, | |
83 void(const std::string& resource_id, | |
84 const ClientContext& context, | |
85 const GetFileCallback& get_file_callback, | |
86 const google_apis::GetContentCallback& get_content_callback)); | |
87 MOCK_METHOD4( | |
88 GetFileContentByPath, | |
89 void(const base::FilePath& file_path, | |
90 const GetFileContentInitializedCallback& initialized_callback, | |
91 const google_apis::GetContentCallback& get_content_callback, | |
92 const FileOperationCallback& completion_callback)); | |
93 MOCK_METHOD3(UpdateFileByResourceId, | |
94 void(const std::string& resource_id, | |
95 const ClientContext& context, | |
96 const FileOperationCallback& callback)); | |
97 MOCK_METHOD2(GetResourceEntryByPath, | |
98 void(const base::FilePath& file_path, | |
99 const GetResourceEntryCallback& callback)); | |
100 MOCK_METHOD2(ReadDirectoryByPath, | |
101 void(const base::FilePath& file_path, | |
102 const ReadDirectoryWithSettingCallback& callback)); | |
103 MOCK_METHOD2(RefreshDirectory, | |
104 void(const base::FilePath& file_path, | |
105 const FileOperationCallback& callback)); | |
106 MOCK_METHOD1(GetAvailableSpace, | |
107 void(const GetAvailableSpaceCallback& callback)); | |
108 MOCK_METHOD1(GetMetadata, | |
109 void(const GetFilesystemMetadataCallback& callback)); | |
110 MOCK_METHOD2(MarkCacheFileAsMounted, | |
111 void(const base::FilePath& drive_file_path, | |
112 const OpenFileCallback& callback)); | |
113 MOCK_METHOD2(MarkCacheFileAsUnmounted, | |
114 void(const base::FilePath& cache_file_path, | |
115 const FileOperationCallback& callback)); | |
116 MOCK_METHOD3(GetCacheEntryByResourceId, | |
117 void(const std::string& resource_id, | |
118 const std::string& md5, | |
119 const GetCacheEntryCallback& callback)); | |
120 MOCK_METHOD0(Reload, void()); | |
121 }; | |
122 | |
123 } // namespace drive | |
124 | |
125 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_FILE_SYSTEM_H_ | |
OLD | NEW |