OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 // This file contains mocks for classes in gdata.h | 5 // This file contains mocks for classes in gdata.h |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ |
8 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ | 8 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // DocumentServiceInterface overrides. | 29 // DocumentServiceInterface overrides. |
30 MOCK_METHOD1(Initialize, void(Profile* profile)); | 30 MOCK_METHOD1(Initialize, void(Profile* profile)); |
31 MOCK_CONST_METHOD0(operation_registry, GDataOperationRegistry*()); | 31 MOCK_CONST_METHOD0(operation_registry, GDataOperationRegistry*()); |
32 MOCK_METHOD0(CancelAll, void(void)); | 32 MOCK_METHOD0(CancelAll, void(void)); |
33 MOCK_METHOD1(Authenticate, void(const AuthStatusCallback& callback)); | 33 MOCK_METHOD1(Authenticate, void(const AuthStatusCallback& callback)); |
34 MOCK_METHOD2(GetDocuments, void(const GURL& feed_url, | 34 MOCK_METHOD2(GetDocuments, void(const GURL& feed_url, |
35 const GetDataCallback& callback)); | 35 const GetDataCallback& callback)); |
36 MOCK_METHOD1(GetAccountMetadata, void(const GetDataCallback& callback)); | 36 MOCK_METHOD1(GetAccountMetadata, void(const GetDataCallback& callback)); |
37 MOCK_METHOD2(DeleteDocument, void(const GURL& document_url, | 37 MOCK_METHOD2(DeleteDocument, void(const GURL& document_url, |
38 const EntryActionCallback& callback)); | 38 const EntryActionCallback& callback)); |
39 MOCK_METHOD4(DownloadDocument, void(const FilePath& virtual_path, | 39 MOCK_METHOD5(DownloadDocument, void(const FilePath& virtual_path, |
| 40 const FilePath& local_cache_path, |
40 const GURL& content_url, | 41 const GURL& content_url, |
41 DocumentExportFormat format, | 42 DocumentExportFormat format, |
42 const DownloadActionCallback& callback)); | 43 const DownloadActionCallback& callback)); |
43 MOCK_METHOD3(CopyDocument, void(const GURL& document_url, | 44 MOCK_METHOD3(CopyDocument, void(const GURL& document_url, |
44 const FilePath::StringType& new_name, | 45 const FilePath::StringType& new_name, |
45 const GetDataCallback& callback)); | 46 const GetDataCallback& callback)); |
46 MOCK_METHOD3(RenameResource, void(const GURL& resource_url, | 47 MOCK_METHOD3(RenameResource, void(const GURL& resource_url, |
47 const FilePath::StringType& new_name, | 48 const FilePath::StringType& new_name, |
48 const EntryActionCallback& callback)); | 49 const EntryActionCallback& callback)); |
49 MOCK_METHOD3(AddResourceToDirectory, | 50 MOCK_METHOD3(AddResourceToDirectory, |
50 void(const GURL& parent_content_url, | 51 void(const GURL& parent_content_url, |
51 const GURL& resource_url, | 52 const GURL& resource_url, |
52 const EntryActionCallback& callback)); | 53 const EntryActionCallback& callback)); |
53 MOCK_METHOD4(RemoveResourceFromDirectory, | 54 MOCK_METHOD4(RemoveResourceFromDirectory, |
54 void(const GURL& parent_content_url, | 55 void(const GURL& parent_content_url, |
55 const GURL& resource_url, | 56 const GURL& resource_url, |
56 const std::string& resource_id, | 57 const std::string& resource_id, |
57 const EntryActionCallback& callback)); | 58 const EntryActionCallback& callback)); |
58 MOCK_METHOD3(CreateDirectory, | 59 MOCK_METHOD3(CreateDirectory, |
59 void(const GURL& parent_content_url, | 60 void(const GURL& parent_content_url, |
60 const FilePath::StringType& directory_name, | 61 const FilePath::StringType& directory_name, |
61 const GetDataCallback& callback)); | 62 const GetDataCallback& callback)); |
62 MOCK_METHOD3(DownloadFile, void(const FilePath& virtual_path, | 63 MOCK_METHOD4(DownloadFile, void(const FilePath& virtual_path, |
| 64 const FilePath& local_cache_path, |
63 const GURL& content_url, | 65 const GURL& content_url, |
64 const DownloadActionCallback& callback)); | 66 const DownloadActionCallback& callback)); |
65 MOCK_METHOD2(InitiateUpload, | 67 MOCK_METHOD2(InitiateUpload, |
66 void(const InitiateUploadParams& upload_file_info, | 68 void(const InitiateUploadParams& upload_file_info, |
67 const InitiateUploadCallback& callback)); | 69 const InitiateUploadCallback& callback)); |
68 MOCK_METHOD2(ResumeUpload, void(const ResumeUploadParams& upload_file_info, | 70 MOCK_METHOD2(ResumeUpload, void(const ResumeUploadParams& upload_file_info, |
69 const ResumeUploadCallback& callback)); | 71 const ResumeUploadCallback& callback)); |
70 | 72 |
71 // Helper stub methods for functions which take callbacks, so that | 73 // Helper stub methods for functions which take callbacks, so that |
72 // the callbacks get called with testable results. | 74 // the callbacks get called with testable results. |
(...skipping 11 matching lines...) Expand all Loading... |
84 // value of |account_metadata_|. | 86 // value of |account_metadata_|. |
85 void GetAccountMetadataStub(const GetDataCallback& callback); | 87 void GetAccountMetadataStub(const GetDataCallback& callback); |
86 | 88 |
87 // Will call |callback| with HTTP_SUCCESS and the |document_url|. | 89 // Will call |callback| with HTTP_SUCCESS and the |document_url|. |
88 void DeleteDocumentStub(const GURL& document_url, | 90 void DeleteDocumentStub(const GURL& document_url, |
89 const EntryActionCallback& callback); | 91 const EntryActionCallback& callback); |
90 | 92 |
91 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path | 93 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path |
92 // portion of the URL as the temporary file path. | 94 // portion of the URL as the temporary file path. |
93 void DownloadDocumentStub(const FilePath& virtual_path, | 95 void DownloadDocumentStub(const FilePath& virtual_path, |
| 96 const FilePath& local_tmp_path, |
94 const GURL& content_url, | 97 const GURL& content_url, |
95 DocumentExportFormat format, | 98 DocumentExportFormat format, |
96 const DownloadActionCallback& callback); | 99 const DownloadActionCallback& callback); |
97 | 100 |
98 // Will call |callback| with HTTP_SUCCESS and the current value of | 101 // Will call |callback| with HTTP_SUCCESS and the current value of |
99 // |document_data_|. | 102 // |document_data_|. |
100 void CopyDocumentStub(const GURL& document_url, | 103 void CopyDocumentStub(const GURL& document_url, |
101 const FilePath::StringType& new_name, | 104 const FilePath::StringType& new_name, |
102 const GetDataCallback& callback); | 105 const GetDataCallback& callback); |
103 | 106 |
(...skipping 15 matching lines...) Expand all Loading... |
119 | 122 |
120 // Will call |callback| with HTTP_SUCCESS and the current value of | 123 // Will call |callback| with HTTP_SUCCESS and the current value of |
121 // |directory_data_|. | 124 // |directory_data_|. |
122 void CreateDirectoryStub(const GURL& parent_content_url, | 125 void CreateDirectoryStub(const GURL& parent_content_url, |
123 const FilePath::StringType& directory_name, | 126 const FilePath::StringType& directory_name, |
124 const GetDataCallback& callback); | 127 const GetDataCallback& callback); |
125 | 128 |
126 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path | 129 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path |
127 // portion of the URL as the temporary file path. | 130 // portion of the URL as the temporary file path. |
128 void DownloadFileStub(const FilePath& virtual_path, | 131 void DownloadFileStub(const FilePath& virtual_path, |
| 132 const FilePath& local_tmp_path, |
129 const GURL& content_url, | 133 const GURL& content_url, |
130 const DownloadActionCallback& callback); | 134 const DownloadActionCallback& callback); |
131 | 135 |
132 void set_account_metadata(base::Value* account_metadata) { | 136 void set_account_metadata(base::Value* account_metadata) { |
133 feed_data_.reset(account_metadata); | 137 feed_data_.reset(account_metadata); |
134 } | 138 } |
135 | 139 |
136 void set_feed_data(base::Value* feed_data) { | 140 void set_feed_data(base::Value* feed_data) { |
137 feed_data_.reset(feed_data); | 141 feed_data_.reset(feed_data); |
138 } | 142 } |
(...skipping 12 matching lines...) Expand all Loading... |
151 // Feed data to be returned from CreateDirectory. | 155 // Feed data to be returned from CreateDirectory. |
152 scoped_ptr<base::Value> directory_data_; | 156 scoped_ptr<base::Value> directory_data_; |
153 | 157 |
154 // Feed data to be returned from CopyDocument. | 158 // Feed data to be returned from CopyDocument. |
155 scoped_ptr<base::Value> document_data_; | 159 scoped_ptr<base::Value> document_data_; |
156 }; | 160 }; |
157 | 161 |
158 } // namespace gdata | 162 } // namespace gdata |
159 | 163 |
160 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ | 164 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_MOCK_H_ |
OLD | NEW |