| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 base::WriteFile(temp_file2_, kTestFileData2, | 143 base::WriteFile(temp_file2_, kTestFileData2, |
| 144 arraysize(kTestFileData2) - 1)); | 144 arraysize(kTestFileData2) - 1)); |
| 145 base::File::Info file_info2; | 145 base::File::Info file_info2; |
| 146 base::GetFileInfo(temp_file2_, &file_info2); | 146 base::GetFileInfo(temp_file2_, &file_info2); |
| 147 temp_file_modification_time2_ = file_info2.last_modified; | 147 temp_file_modification_time2_ = file_info2.last_modified; |
| 148 | 148 |
| 149 disk_cache_backend_ = CreateInMemoryDiskCache(); | 149 disk_cache_backend_ = CreateInMemoryDiskCache(); |
| 150 disk_cache_entry_ = CreateDiskCacheEntry( | 150 disk_cache_entry_ = CreateDiskCacheEntry( |
| 151 disk_cache_backend_.get(), kTestDiskCacheKey, kTestDiskCacheData); | 151 disk_cache_backend_.get(), kTestDiskCacheKey, kTestDiskCacheData); |
| 152 | 152 |
| 153 url_request_job_factory_.SetProtocolHandler("blob", | 153 url_request_job_factory_.SetProtocolHandler( |
| 154 new MockProtocolHandler(this)); | 154 "blob", make_scoped_ptr(new MockProtocolHandler(this))); |
| 155 url_request_context_.set_job_factory(&url_request_job_factory_); | 155 url_request_context_.set_job_factory(&url_request_job_factory_); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void TearDown() override { | 158 void TearDown() override { |
| 159 blob_handle_.reset(); | 159 blob_handle_.reset(); |
| 160 // Clean up for ASAN | 160 // Clean up for ASAN |
| 161 base::RunLoop run_loop; | 161 base::RunLoop run_loop; |
| 162 run_loop.RunUntilIdle(); | 162 run_loop.RunUntilIdle(); |
| 163 } | 163 } |
| 164 | 164 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); | 503 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); |
| 504 EXPECT_EQ(kTestContentType, content_type); | 504 EXPECT_EQ(kTestContentType, content_type); |
| 505 void* iter = NULL; | 505 void* iter = NULL; |
| 506 std::string content_disposition; | 506 std::string content_disposition; |
| 507 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( | 507 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( |
| 508 &iter, "Content-Disposition", &content_disposition)); | 508 &iter, "Content-Disposition", &content_disposition)); |
| 509 EXPECT_EQ(kTestContentDisposition, content_disposition); | 509 EXPECT_EQ(kTestContentDisposition, content_disposition); |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace content | 512 } // namespace content |
| OLD | NEW |