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

Unified Diff: content/public/test/test_file_error_injector.cc

Issue 2712713007: Make DownloadFileImpl handle multiple byte streams. (Closed)
Patch Set: Remove the AppendDataToFile call, fix the browsertest. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/mock_download_file.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_file_error_injector.cc
diff --git a/content/public/test/test_file_error_injector.cc b/content/public/test/test_file_error_injector.cc
index 482720544381d78ca52bc9574a30b847b582c923..55e11b8e5dae0466e0b0307ad7e8dfc1cf72e1ec 100644
--- a/content/public/test/test_file_error_injector.cc
+++ b/content/public/test/test_file_error_injector.cc
@@ -44,8 +44,10 @@ class DownloadFileWithError: public DownloadFileImpl {
void Initialize(const InitializeCallback& callback) override;
// DownloadFile interface.
- DownloadInterruptReason AppendDataToFile(const char* data,
- size_t data_len) override;
+ DownloadInterruptReason WriteDataToFile(int64_t offset,
+ const char* data,
+ size_t data_len) override;
+
void RenameAndUniquify(const base::FilePath& full_path,
const RenameCompletionCallback& callback) override;
void RenameAndAnnotate(const base::FilePath& full_path,
@@ -111,6 +113,7 @@ DownloadFileWithError::DownloadFileWithError(
default_download_directory,
std::move(byte_stream),
net_log,
+ false, /* is_sparse_file */
observer),
error_info_(error_info),
destruction_callback_(dtor_callback) {
@@ -154,11 +157,13 @@ void DownloadFileWithError::Initialize(
DownloadFileImpl::Initialize(callback_to_use);
}
-DownloadInterruptReason DownloadFileWithError::AppendDataToFile(
- const char* data, size_t data_len) {
+DownloadInterruptReason DownloadFileWithError::WriteDataToFile(
+ int64_t offset,
+ const char* data,
+ size_t data_len) {
return ShouldReturnError(
TestFileErrorInjector::FILE_OPERATION_WRITE,
- DownloadFileImpl::AppendDataToFile(data, data_len));
+ DownloadFileImpl::WriteDataToFile(offset, data, data_len));
}
void DownloadFileWithError::RenameAndUniquify(
« no previous file with comments | « content/browser/download/mock_download_file.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698