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.
5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_MOCK_GDATA_FILE_SYSTEM_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_MOCK_GDATA_FILE_SYSTEM_H_
10 #include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h"
11 #include "testing/gmock/include/gmock/gmock.h"
15 // Mock for GDataFileSystemInterface.
16 class MockGDataFileSystem
: public GDataFileSystemInterface
{
18 MockGDataFileSystem();
19 virtual ~MockGDataFileSystem();
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(CheckForUpdates
, void());
28 MOCK_METHOD2(GetFileInfoByResourceId
,
29 void(const std::string
& resource_id
,
30 const GetFileInfoWithFilePathCallback
& callback
));
31 MOCK_METHOD2(Search
, void(const std::string
& search_query
,
32 const SearchCallback
& callback
));
33 MOCK_METHOD3(TransferFileFromRemoteToLocal
,
34 void(const FilePath
& local_src_file_path
,
35 const FilePath
& remote_dest_file_path
,
36 const FileOperationCallback
& callback
));
37 MOCK_METHOD3(TransferFileFromLocalToRemote
,
38 void(const FilePath
& local_src_file_path
,
39 const FilePath
& remote_dest_file_path
,
40 const FileOperationCallback
& callback
));
41 MOCK_METHOD2(OpenFile
, void(const FilePath
& file_path
,
42 const OpenFileCallback
& callback
));
43 MOCK_METHOD2(CloseFile
, void(const FilePath
& file_path
,
44 const FileOperationCallback
& callback
));
45 MOCK_METHOD3(Copy
, void(const FilePath
& src_file_path
,
46 const FilePath
& dest_file_path
,
47 const FileOperationCallback
& callback
));
48 MOCK_METHOD3(Move
, void(const FilePath
& src_file_path
,
49 const FilePath
& dest_file_path
,
50 const FileOperationCallback
& callback
));
51 MOCK_METHOD3(Remove
, void(const FilePath
& file_path
,
53 const FileOperationCallback
& callback
));
54 MOCK_METHOD4(CreateDirectory
,
55 void(const FilePath
& directory_path
,
58 const FileOperationCallback
& callback
));
59 MOCK_METHOD3(CreateFile
,
60 void(const FilePath
& file_path
,
62 const FileOperationCallback
& callback
));
63 MOCK_METHOD3(GetFileByPath
,
64 void(const FilePath
& file_path
,
65 const GetFileCallback
& get_file_callback
,
66 const GetDownloadDataCallback
& get_download_data_callback
));
67 MOCK_METHOD3(GetFileByResourceId
,
68 void(const std::string
& resource_id
,
69 const GetFileCallback
& get_file_callback
,
70 const GetDownloadDataCallback
& get_download_data_callback
));
71 MOCK_METHOD2(UpdateFileByResourceId
,
72 void(const std::string
& resource_id
,
73 const FileOperationCallback
& callback
));
74 MOCK_METHOD2(GetFileInfoByPath
, void(const FilePath
& file_path
,
75 const GetFileInfoCallback
& callback
));
76 MOCK_METHOD2(GetEntryInfoByPath
, void(const FilePath
& file_path
,
77 const GetEntryInfoCallback
& callback
));
78 MOCK_METHOD2(ReadDirectoryByPath
,
79 void(const FilePath
& file_path
,
80 const ReadDirectoryCallback
& callback
));
81 MOCK_METHOD1(RequestDirectoryRefresh
,
82 void(const FilePath
& file_path
));
83 MOCK_METHOD1(GetAvailableSpace
,
84 void(const GetAvailableSpaceCallback
& callback
));
85 // This function is not mockable by gmock because scoped_ptr is not supported.
86 virtual void AddUploadedFile(UploadMode upload_mode
,
88 scoped_ptr
<DocumentEntry
> entry
,
89 const FilePath
& file_content_path
,
90 GDataCache::FileOperationType cache_operation
,
91 const base::Closure
& callback
) OVERRIDE
{}
96 #endif // CHROME_BROWSER_CHROMEOS_GDATA_MOCK_GDATA_FILE_SYSTEM_H_