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

Side by Side Diff: chrome/browser/google_apis/mock_drive_service.h

Issue 14215003: Add ProgressCallback to DriveServiceInterface::DownloadFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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_GOOGLE_APIS_MOCK_DRIVE_SERVICE_H_ 7 #ifndef CHROME_BROWSER_GOOGLE_APIS_MOCK_DRIVE_SERVICE_H_
8 #define CHROME_BROWSER_GOOGLE_APIS_MOCK_DRIVE_SERVICE_H_ 8 #define CHROME_BROWSER_GOOGLE_APIS_MOCK_DRIVE_SERVICE_H_
9 9
10 #include <string> 10 #include <string>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const std::string& resource_id, 80 const std::string& resource_id,
81 const EntryActionCallback& callback)); 81 const EntryActionCallback& callback));
82 MOCK_METHOD3(RemoveResourceFromDirectory, 82 MOCK_METHOD3(RemoveResourceFromDirectory,
83 void(const std::string& parent_resource_id, 83 void(const std::string& parent_resource_id,
84 const std::string& resource_id, 84 const std::string& resource_id,
85 const EntryActionCallback& callback)); 85 const EntryActionCallback& callback));
86 MOCK_METHOD3(AddNewDirectory, 86 MOCK_METHOD3(AddNewDirectory,
87 void(const std::string& parent_resource_id, 87 void(const std::string& parent_resource_id,
88 const std::string& directory_name, 88 const std::string& directory_name,
89 const GetResourceEntryCallback& callback)); 89 const GetResourceEntryCallback& callback));
90 MOCK_METHOD5( 90 MOCK_METHOD6(
91 DownloadFile, 91 DownloadFile,
92 void(const base::FilePath& virtual_path, 92 void(const base::FilePath& virtual_path,
93 const base::FilePath& local_cache_path, 93 const base::FilePath& local_cache_path,
94 const GURL& download_url, 94 const GURL& download_url,
95 const DownloadActionCallback& donwload_action_callback, 95 const DownloadActionCallback& donwload_action_callback,
96 const GetContentCallback& get_content_callback)); 96 const GetContentCallback& get_content_callback,
97 const ProgressCallback& progress_callback));
97 MOCK_METHOD6(InitiateUploadNewFile, 98 MOCK_METHOD6(InitiateUploadNewFile,
98 void(const base::FilePath& drive_file_path, 99 void(const base::FilePath& drive_file_path,
99 const std::string& content_type, 100 const std::string& content_type,
100 int64 content_length, 101 int64 content_length,
101 const std::string& parent_resource_id, 102 const std::string& parent_resource_id,
102 const std::string& title, 103 const std::string& title,
103 const InitiateUploadCallback& callback)); 104 const InitiateUploadCallback& callback));
104 MOCK_METHOD6(InitiateUploadExistingFile, 105 MOCK_METHOD6(InitiateUploadExistingFile,
105 void(const base::FilePath& drive_file_path, 106 void(const base::FilePath& drive_file_path,
106 const std::string& content_type, 107 const std::string& content_type,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 const GetResourceEntryCallback& callback); 182 const GetResourceEntryCallback& callback);
182 183
183 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path 184 // Will call |callback| with HTTP_SUCCESS, the given URL, and the host+path
184 // portion of the URL as the temporary file path. If |file_data_| is not null, 185 // portion of the URL as the temporary file path. If |file_data_| is not null,
185 // |file_data_| is written to the temporary file. 186 // |file_data_| is written to the temporary file.
186 void DownloadFileStub( 187 void DownloadFileStub(
187 const base::FilePath& virtual_path, 188 const base::FilePath& virtual_path,
188 const base::FilePath& local_tmp_path, 189 const base::FilePath& local_tmp_path,
189 const GURL& download_url, 190 const GURL& download_url,
190 const DownloadActionCallback& download_action_callback, 191 const DownloadActionCallback& download_action_callback,
191 const GetContentCallback& get_content_callback); 192 const GetContentCallback& get_content_callback,
193 const ProgressCallback& progress_callback);
192 194
193 // Account meta data to be returned from GetAccountMetadata. 195 // Account meta data to be returned from GetAccountMetadata.
194 scoped_ptr<base::Value> account_metadata_data_; 196 scoped_ptr<base::Value> account_metadata_data_;
195 197
196 // JSON data to be returned from CreateDirectory. 198 // JSON data to be returned from CreateDirectory.
197 scoped_ptr<base::Value> directory_data_; 199 scoped_ptr<base::Value> directory_data_;
198 200
199 // JSON data to be returned from CopyHostedDocument. 201 // JSON data to be returned from CopyHostedDocument.
200 scoped_ptr<base::Value> document_data_; 202 scoped_ptr<base::Value> document_data_;
201 203
202 // File data to be written to the local temporary file when 204 // File data to be written to the local temporary file when
203 // DownloadFileStub is called. 205 // DownloadFileStub is called.
204 scoped_ptr<std::string> file_data_; 206 scoped_ptr<std::string> file_data_;
205 }; 207 };
206 208
207 } // namespace google_apis 209 } // namespace google_apis
208 210
209 #endif // CHROME_BROWSER_GOOGLE_APIS_MOCK_DRIVE_SERVICE_H_ 211 #endif // CHROME_BROWSER_GOOGLE_APIS_MOCK_DRIVE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_service.cc ('k') | chrome/browser/google_apis/mock_drive_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698