OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 arraysize(kTestFileData2) - 1)); | 167 arraysize(kTestFileData2) - 1)); |
168 base::File::Info file_info2; | 168 base::File::Info file_info2; |
169 base::GetFileInfo(temp_file2_, &file_info2); | 169 base::GetFileInfo(temp_file2_, &file_info2); |
170 temp_file_modification_time2_ = file_info2.last_modified; | 170 temp_file_modification_time2_ = file_info2.last_modified; |
171 | 171 |
172 disk_cache_backend_ = CreateInMemoryDiskCache(); | 172 disk_cache_backend_ = CreateInMemoryDiskCache(); |
173 disk_cache_entry_ = CreateDiskCacheEntry( | 173 disk_cache_entry_ = CreateDiskCacheEntry( |
174 disk_cache_backend_.get(), kTestDiskCacheKey1, kTestDiskCacheData1); | 174 disk_cache_backend_.get(), kTestDiskCacheKey1, kTestDiskCacheData1); |
175 | 175 |
176 url_request_job_factory_.SetProtocolHandler( | 176 url_request_job_factory_.SetProtocolHandler( |
177 "blob", base::WrapUnique(new MockProtocolHandler(this))); | 177 "blob", base::MakeUnique<MockProtocolHandler>(this)); |
178 url_request_context_.set_job_factory(&url_request_job_factory_); | 178 url_request_context_.set_job_factory(&url_request_job_factory_); |
179 } | 179 } |
180 | 180 |
181 void TearDown() override { | 181 void TearDown() override { |
182 blob_handle_.reset(); | 182 blob_handle_.reset(); |
183 request_.reset(); | 183 request_.reset(); |
184 // Clean up for ASAN | 184 // Clean up for ASAN |
185 base::RunLoop run_loop; | 185 base::RunLoop run_loop; |
186 run_loop.RunUntilIdle(); | 186 run_loop.RunUntilIdle(); |
187 } | 187 } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 expected_status_code_ = 200; | 597 expected_status_code_ = 200; |
598 expected_response_ = kTestDiskCacheData2; | 598 expected_response_ = kTestDiskCacheData2; |
599 TestRequest("GET", net::HttpRequestHeaders()); | 599 TestRequest("GET", net::HttpRequestHeaders()); |
600 EXPECT_EQ(static_cast<int>(arraysize(kTestDiskCacheData2) - 1), | 600 EXPECT_EQ(static_cast<int>(arraysize(kTestDiskCacheData2) - 1), |
601 request_->response_headers()->GetContentLength()); | 601 request_->response_headers()->GetContentLength()); |
602 | 602 |
603 EXPECT_FALSE(url_request_delegate_.metadata()); | 603 EXPECT_FALSE(url_request_delegate_.metadata()); |
604 } | 604 } |
605 | 605 |
606 } // namespace content | 606 } // namespace content |
OLD | NEW |