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

Unified Diff: content/browser/fileapi/blob_url_request_job_unittest.cc

Issue 1337153002: [Blob] BlobReader class & tests, and removal of all redundant reading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows fix Created 5 years, 3 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
Index: content/browser/fileapi/blob_url_request_job_unittest.cc
diff --git a/content/browser/fileapi/blob_url_request_job_unittest.cc b/content/browser/fileapi/blob_url_request_job_unittest.cc
index 9debd4dc6715caf70b602336f2a6d713a3734665..f4708df506d0a9d338001f2048e1102683de5622 100644
--- a/content/browser/fileapi/blob_url_request_job_unittest.cc
+++ b/content/browser/fileapi/blob_url_request_job_unittest.cc
@@ -115,7 +115,7 @@ class BlobURLRequestJobTest : public testing::Test {
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override {
return new BlobURLRequestJob(request, network_delegate,
- test_->GetSnapshotFromBuilder(),
+ test_->GetHandleFromBuilder(),
test_->file_system_context_.get(),
base::ThreadTaskRunnerHandle::Get().get());
}
@@ -282,18 +282,19 @@ class BlobURLRequestJobTest : public testing::Test {
*expected_result += std::string(kTestFileSystemFileData2 + 6, 7);
}
- scoped_ptr<BlobDataSnapshot> GetSnapshotFromBuilder() {
+ storage::BlobDataHandle* GetHandleFromBuilder() {
if (!blob_handle_) {
blob_handle_ = blob_context_.AddFinishedBlob(blob_data_.get()).Pass();
}
- return blob_handle_->CreateSnapshot().Pass();
+ return blob_handle_.get();
}
// This only works if all the Blob items have a definite pre-computed length.
// Otherwise, this will fail a CHECK.
int64 GetTotalBlobLength() {
int64 total = 0;
- scoped_ptr<BlobDataSnapshot> data = GetSnapshotFromBuilder();
+ scoped_ptr<BlobDataSnapshot> data =
+ GetHandleFromBuilder()->CreateSnapshot();
const auto& items = data->items();
for (const auto& item : items) {
int64 length = base::checked_cast<int64>(item->length());

Powered by Google App Engine
This is Rietveld 408576698