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_GDATA_MOCK_GDATA_FILE_SYSTEM_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_MOCK_GDATA_FILE_SYSTEM_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h" | |
11 #include "testing/gmock/include/gmock/gmock.h" | |
12 | |
13 namespace gdata { | |
14 | |
15 // Mock for GDataFileSystemInterface. | |
16 class MockGDataFileSystem : public GDataFileSystemInterface { | |
17 public: | |
18 MockGDataFileSystem(); | |
19 virtual ~MockGDataFileSystem(); | |
20 | |
21 // GDataFileSystemInterface overrides. | |
22 MOCK_METHOD0(Initialize, void()); | |
23 MOCK_METHOD1(AddObserver, void(Observer* observer)); | |
24 MOCK_METHOD1(RemoveObserver, void(Observer* observer)); | |
25 MOCK_METHOD0(StartUpdates, void()); | |
26 MOCK_METHOD0(StopUpdates, void()); | |
27 MOCK_METHOD0(NotifyFileSystemMounted, void()); | |
28 MOCK_METHOD0(NotifyFileSystemToBeUnmounted, void()); | |
29 MOCK_METHOD0(CheckForUpdates, void()); | |
30 MOCK_METHOD2(GetEntryInfoByResourceId, | |
31 void(const std::string& resource_id, | |
32 const GetEntryInfoWithFilePathCallback& callback)); | |
33 MOCK_METHOD3(Search, void(const std::string& search_query, | |
34 const GURL& next_feed, | |
35 const SearchCallback& callback)); | |
36 MOCK_METHOD3(TransferFileFromRemoteToLocal, | |
37 void(const FilePath& local_src_file_path, | |
38 const FilePath& remote_dest_file_path, | |
39 const FileOperationCallback& callback)); | |
40 MOCK_METHOD3(TransferFileFromLocalToRemote, | |
41 void(const FilePath& local_src_file_path, | |
42 const FilePath& remote_dest_file_path, | |
43 const FileOperationCallback& callback)); | |
44 MOCK_METHOD2(OpenFile, void(const FilePath& file_path, | |
45 const OpenFileCallback& callback)); | |
46 MOCK_METHOD2(CloseFile, void(const FilePath& file_path, | |
47 const FileOperationCallback& callback)); | |
48 MOCK_METHOD3(Copy, void(const FilePath& src_file_path, | |
49 const FilePath& dest_file_path, | |
50 const FileOperationCallback& callback)); | |
51 MOCK_METHOD3(Move, void(const FilePath& src_file_path, | |
52 const FilePath& dest_file_path, | |
53 const FileOperationCallback& callback)); | |
54 MOCK_METHOD3(Remove, void(const FilePath& file_path, | |
55 bool is_recursive, | |
56 const FileOperationCallback& callback)); | |
57 MOCK_METHOD4(CreateDirectory, | |
58 void(const FilePath& directory_path, | |
59 bool is_exclusive, | |
60 bool is_recursive, | |
61 const FileOperationCallback& callback)); | |
62 MOCK_METHOD3(CreateFile, | |
63 void(const FilePath& file_path, | |
64 bool is_exclusive, | |
65 const FileOperationCallback& callback)); | |
66 MOCK_METHOD3(GetFileByPath, | |
67 void(const FilePath& file_path, | |
68 const GetFileCallback& get_file_callback, | |
69 const GetContentCallback& get_content_callback)); | |
70 MOCK_METHOD3(GetFileByResourceId, | |
71 void(const std::string& resource_id, | |
72 const GetFileCallback& get_file_callback, | |
73 const GetContentCallback& get_content_callback)); | |
74 MOCK_METHOD2(UpdateFileByResourceId, | |
75 void(const std::string& resource_id, | |
76 const FileOperationCallback& callback)); | |
77 MOCK_METHOD2(GetEntryInfoByPath, void(const FilePath& file_path, | |
78 const GetEntryInfoCallback& callback)); | |
79 MOCK_METHOD2(ReadDirectoryByPath, | |
80 void(const FilePath& file_path, | |
81 const ReadDirectoryWithSettingCallback& callback)); | |
82 MOCK_METHOD1(RequestDirectoryRefresh, | |
83 void(const FilePath& file_path)); | |
84 MOCK_METHOD1(GetAvailableSpace, | |
85 void(const GetAvailableSpaceCallback& callback)); | |
86 // This function is not mockable by gmock because scoped_ptr is not supported. | |
87 virtual void AddUploadedFile(UploadMode upload_mode, | |
88 const FilePath& file, | |
89 scoped_ptr<DocumentEntry> entry, | |
90 const FilePath& file_content_path, | |
91 DriveCache::FileOperationType cache_operation, | |
92 const base::Closure& callback) OVERRIDE {} | |
93 // This function is not mockable by gmock because scoped_ptr is not supported. | |
94 virtual void UpdateEntryData(const std::string& resource_id, | |
95 const std::string& md5, | |
96 scoped_ptr<DocumentEntry> entry, | |
97 const FilePath& file_content_path, | |
98 const base::Closure& callback) OVERRIDE {} | |
99 }; | |
100 | |
101 } // namespace gdata | |
102 | |
103 #endif // CHROME_BROWSER_CHROMEOS_GDATA_MOCK_GDATA_FILE_SYSTEM_H_ | |
OLD | NEW |