| 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 96becf0de0935ae062abb6c67546b526fc088cd6..9debd4dc6715caf70b602336f2a6d713a3734665 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 @@
|
| net::URLRequest* request,
|
| net::NetworkDelegate* network_delegate) const override {
|
| return new BlobURLRequestJob(request, network_delegate,
|
| - test_->GetHandleFromBuilder(),
|
| + test_->GetSnapshotFromBuilder(),
|
| test_->file_system_context_.get(),
|
| base::ThreadTaskRunnerHandle::Get().get());
|
| }
|
| @@ -157,7 +157,6 @@
|
|
|
| void TearDown() override {
|
| blob_handle_.reset();
|
| - request_.reset();
|
| // Clean up for ASAN
|
| base::RunLoop run_loop;
|
| run_loop.RunUntilIdle();
|
| @@ -283,19 +282,18 @@
|
| *expected_result += std::string(kTestFileSystemFileData2 + 6, 7);
|
| }
|
|
|
| - storage::BlobDataHandle* GetHandleFromBuilder() {
|
| + scoped_ptr<BlobDataSnapshot> GetSnapshotFromBuilder() {
|
| if (!blob_handle_) {
|
| blob_handle_ = blob_context_.AddFinishedBlob(blob_data_.get()).Pass();
|
| }
|
| - return blob_handle_.get();
|
| + return blob_handle_->CreateSnapshot().Pass();
|
| }
|
|
|
| // 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 =
|
| - GetHandleFromBuilder()->CreateSnapshot();
|
| + scoped_ptr<BlobDataSnapshot> data = GetSnapshotFromBuilder();
|
| const auto& items = data->items();
|
| for (const auto& item : items) {
|
| int64 length = base::checked_cast<int64>(item->length());
|
| @@ -493,27 +491,6 @@
|
| EXPECT_EQ(total, length);
|
| }
|
|
|
| -TEST_F(BlobURLRequestJobTest, TestGetRangeRequest3) {
|
| - SetUpFileSystem();
|
| - std::string result;
|
| - BuildComplicatedData(&result);
|
| - net::HttpRequestHeaders extra_headers;
|
| - extra_headers.SetHeader(net::HttpRequestHeaders::kRange,
|
| - net::HttpByteRange::Bounded(0, 2).GetHeaderValue());
|
| - expected_status_code_ = 206;
|
| - expected_response_ = result.substr(0, 3);
|
| - TestRequest("GET", extra_headers);
|
| -
|
| - EXPECT_EQ(3, request_->response_headers()->GetContentLength());
|
| -
|
| - int64 first = 0, last = 0, length = 0;
|
| - EXPECT_TRUE(
|
| - request_->response_headers()->GetContentRange(&first, &last, &length));
|
| - EXPECT_EQ(0, first);
|
| - EXPECT_EQ(2, last);
|
| - EXPECT_EQ(GetTotalBlobLength(), length);
|
| -}
|
| -
|
| TEST_F(BlobURLRequestJobTest, TestExtraHeaders) {
|
| blob_data_->set_content_type(kTestContentType);
|
| blob_data_->set_content_disposition(kTestContentDisposition);
|
|
|