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

Side by Side Diff: chrome/browser/chromeos/drive/mock_drive_service.h

Issue 11143014: Add request header on gdata operation for testing ETag match. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix & test fix Created 8 years, 2 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
OLDNEW
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 drive_service_interface.h 5 // This file contains mocks for classes in drive_service_interface.h
6 6
7 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_DRIVE_SERVICE_H_ 7 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_DRIVE_SERVICE_H_
8 #define CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_DRIVE_SERVICE_H_ 8 #define CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_DRIVE_SERVICE_H_
9 9
10 #include <string> 10 #include <string>
(...skipping 26 matching lines...) Expand all
37 int64 start_changestamp, 37 int64 start_changestamp,
38 const std::string& search_string, 38 const std::string& search_string,
39 const std::string& directory_resource_id, 39 const std::string& directory_resource_id,
40 const gdata::GetDataCallback& callback)); 40 const gdata::GetDataCallback& callback));
41 MOCK_METHOD2(GetDocumentEntry, void(const std::string& resource_id, 41 MOCK_METHOD2(GetDocumentEntry, void(const std::string& resource_id,
42 const gdata::GetDataCallback& callback)); 42 const gdata::GetDataCallback& callback));
43 MOCK_METHOD1(GetAccountMetadata, 43 MOCK_METHOD1(GetAccountMetadata,
44 void(const gdata::GetDataCallback& callback)); 44 void(const gdata::GetDataCallback& callback));
45 MOCK_METHOD1(GetApplicationInfo, 45 MOCK_METHOD1(GetApplicationInfo,
46 void(const gdata::GetDataCallback& callback)); 46 void(const gdata::GetDataCallback& callback));
47 MOCK_METHOD2(DeleteDocument, 47 MOCK_METHOD3(DeleteDocument,
48 void(const GURL& document_url, 48 void(const GURL& document_url,
49 const std::string& etag,
49 const gdata::EntryActionCallback& callback)); 50 const gdata::EntryActionCallback& callback));
50 MOCK_METHOD5(DownloadDocument, 51 MOCK_METHOD6(DownloadDocument,
51 void(const FilePath& virtual_path, 52 void(const FilePath& virtual_path,
52 const FilePath& local_cache_path, 53 const FilePath& local_cache_path,
53 const GURL& content_url, 54 const GURL& content_url,
54 DocumentExportFormat format, 55 DocumentExportFormat format,
56 const std::string& etag,
55 const gdata::DownloadActionCallback& callback)); 57 const gdata::DownloadActionCallback& callback));
56 MOCK_METHOD3(CopyDocument, void(const std::string& resource_id, 58 MOCK_METHOD3(CopyDocument, void(const std::string& resource_id,
57 const FilePath::StringType& new_name, 59 const FilePath::StringType& new_name,
58 const gdata::GetDataCallback& callback)); 60 const gdata::GetDataCallback& callback));
59 MOCK_METHOD3(RenameResource, 61 MOCK_METHOD3(RenameResource,
60 void(const GURL& resource_url, 62 void(const GURL& resource_url,
61 const FilePath::StringType& new_name, 63 const FilePath::StringType& new_name,
62 const gdata::EntryActionCallback& callback)); 64 const gdata::EntryActionCallback& callback));
63 MOCK_METHOD3(AddResourceToDirectory, 65 MOCK_METHOD3(AddResourceToDirectory,
64 void(const GURL& parent_content_url, 66 void(const GURL& parent_content_url,
65 const GURL& resource_url, 67 const GURL& resource_url,
66 const gdata::EntryActionCallback& callback)); 68 const gdata::EntryActionCallback& callback));
67 MOCK_METHOD4(RemoveResourceFromDirectory, 69 MOCK_METHOD4(RemoveResourceFromDirectory,
68 void(const GURL& parent_content_url, 70 void(const GURL& parent_content_url,
69 const GURL& resource_url, 71 const GURL& resource_url,
70 const std::string& resource_id, 72 const std::string& resource_id,
71 const gdata::EntryActionCallback& callback)); 73 const gdata::EntryActionCallback& callback));
72 MOCK_METHOD3(CreateDirectory, 74 MOCK_METHOD3(CreateDirectory,
73 void(const GURL& parent_content_url, 75 void(const GURL& parent_content_url,
74 const FilePath::StringType& directory_name, 76 const FilePath::StringType& directory_name,
75 const gdata::GetDataCallback& callback)); 77 const gdata::GetDataCallback& callback));
76 MOCK_METHOD5(DownloadFile, 78 MOCK_METHOD6(DownloadFile,
77 void(const FilePath& virtual_path, 79 void(const FilePath& virtual_path,
78 const FilePath& local_cache_path, 80 const FilePath& local_cache_path,
79 const GURL& content_url, 81 const GURL& content_url,
82 const std::string& etag,
80 const gdata::DownloadActionCallback& 83 const gdata::DownloadActionCallback&
81 donwload_action_callback, 84 donwload_action_callback,
82 const gdata::GetContentCallback& get_content_callback)); 85 const gdata::GetContentCallback& get_content_callback));
83 MOCK_METHOD2(InitiateUpload, 86 MOCK_METHOD2(InitiateUpload,
84 void(const gdata::InitiateUploadParams& upload_file_info, 87 void(const gdata::InitiateUploadParams& upload_file_info,
85 const gdata::InitiateUploadCallback& callback)); 88 const gdata::InitiateUploadCallback& callback));
86 MOCK_METHOD2(ResumeUpload, 89 MOCK_METHOD2(ResumeUpload,
87 void(const gdata::ResumeUploadParams& upload_file_info, 90 void(const gdata::ResumeUploadParams& upload_file_info,
88 const gdata::ResumeUploadCallback& callback)); 91 const gdata::ResumeUploadCallback& callback));
89 MOCK_METHOD3(AuthorizeApp, void(const GURL& resource_url, 92 MOCK_METHOD3(AuthorizeApp, void(const GURL& resource_url,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 const std::string& search_string, 128 const std::string& search_string,
126 const std::string& directory_resource_id, 129 const std::string& directory_resource_id,
127 const gdata::GetDataCallback& callback); 130 const gdata::GetDataCallback& callback);
128 131
129 // Will call |callback| with HTTP_SUCCESS and a StringValue with the current 132 // Will call |callback| with HTTP_SUCCESS and a StringValue with the current
130 // value of |account_metadata_|. 133 // value of |account_metadata_|.
131 void GetAccountMetadataStub(const gdata::GetDataCallback& callback); 134 void GetAccountMetadataStub(const gdata::GetDataCallback& callback);
132 135
133 // Will call |callback| with HTTP_SUCCESS and the |document_url|. 136 // Will call |callback| with HTTP_SUCCESS and the |document_url|.
134 void DeleteDocumentStub(const GURL& document_url, 137 void DeleteDocumentStub(const GURL& document_url,
138 const std::string& etag,
135 const gdata::EntryActionCallback& callback); 139 const gdata::EntryActionCallback& callback);
136 140
137 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path 141 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path
138 // portion of the URL as the temporary file path. 142 // portion of the URL as the temporary file path.
139 void DownloadDocumentStub(const FilePath& virtual_path, 143 void DownloadDocumentStub(const FilePath& virtual_path,
140 const FilePath& local_tmp_path, 144 const FilePath& local_tmp_path,
141 const GURL& content_url, 145 const GURL& content_url,
142 DocumentExportFormat format, 146 DocumentExportFormat format,
147 const std::string& etag,
143 const gdata::DownloadActionCallback& callback); 148 const gdata::DownloadActionCallback& callback);
144 149
145 // Will call |callback| with HTTP_SUCCESS and the current value of 150 // Will call |callback| with HTTP_SUCCESS and the current value of
146 // |document_data_|. 151 // |document_data_|.
147 void CopyDocumentStub(const std::string& resource_id, 152 void CopyDocumentStub(const std::string& resource_id,
148 const FilePath::StringType& new_name, 153 const FilePath::StringType& new_name,
149 const gdata::GetDataCallback& callback); 154 const gdata::GetDataCallback& callback);
150 155
151 // Will call |callback| with HTTP_SUCCESS and the |document_url|. 156 // Will call |callback| with HTTP_SUCCESS and the |document_url|.
152 void RenameResourceStub(const GURL& document_url, 157 void RenameResourceStub(const GURL& document_url,
(...skipping 18 matching lines...) Expand all
171 const FilePath::StringType& directory_name, 176 const FilePath::StringType& directory_name,
172 const gdata::GetDataCallback& callback); 177 const gdata::GetDataCallback& callback);
173 178
174 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path 179 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path
175 // portion of the URL as the temporary file path. If |file_data_| is not null, 180 // portion of the URL as the temporary file path. If |file_data_| is not null,
176 // |file_data_| is written to the temporary file. 181 // |file_data_| is written to the temporary file.
177 void DownloadFileStub( 182 void DownloadFileStub(
178 const FilePath& virtual_path, 183 const FilePath& virtual_path,
179 const FilePath& local_tmp_path, 184 const FilePath& local_tmp_path,
180 const GURL& content_url, 185 const GURL& content_url,
186 const std::string& etag,
181 const gdata::DownloadActionCallback& download_action_callback, 187 const gdata::DownloadActionCallback& download_action_callback,
182 const gdata::GetContentCallback& get_content_callback); 188 const gdata::GetContentCallback& get_content_callback);
183 189
184 // Account meta data to be returned from GetAccountMetadata. 190 // Account meta data to be returned from GetAccountMetadata.
185 scoped_ptr<base::Value> account_metadata_; 191 scoped_ptr<base::Value> account_metadata_;
186 192
187 // Feed data to be returned from GetDocuments. 193 // Feed data to be returned from GetDocuments.
188 scoped_ptr<base::Value> feed_data_; 194 scoped_ptr<base::Value> feed_data_;
189 195
190 // Feed data to be returned from CreateDirectory. 196 // Feed data to be returned from CreateDirectory.
191 scoped_ptr<base::Value> directory_data_; 197 scoped_ptr<base::Value> directory_data_;
192 198
193 // Feed data to be returned from CopyDocument. 199 // Feed data to be returned from CopyDocument.
194 scoped_ptr<base::Value> document_data_; 200 scoped_ptr<base::Value> document_data_;
195 201
196 // Feed data to be returned from GetDocuments if the search path is specified. 202 // Feed data to be returned from GetDocuments if the search path is specified.
197 // The feed contains subset of the root_feed. 203 // The feed contains subset of the root_feed.
198 scoped_ptr<base::Value> search_result_; 204 scoped_ptr<base::Value> search_result_;
199 205
200 // File data to be written to the local temporary file when 206 // File data to be written to the local temporary file when
201 // DownloadDocumentStub is called. 207 // DownloadDocumentStub is called.
202 scoped_ptr<std::string> file_data_; 208 scoped_ptr<std::string> file_data_;
203 }; 209 };
204 210
205 } // namespace drive 211 } // namespace drive
206 212
207 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_DRIVE_SERVICE_H_ 213 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_MOCK_DRIVE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698