| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 3408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3419 ShareableFileReference::GetOrCreate( | 3419 ShareableFileReference::GetOrCreate( |
| 3420 file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, | 3420 file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, |
| 3421 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); | 3421 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); |
| 3422 | 3422 |
| 3423 // Not readable. | 3423 // Not readable. |
| 3424 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 3424 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
| 3425 filter_->child_id(), file_path)); | 3425 filter_->child_id(), file_path)); |
| 3426 | 3426 |
| 3427 // Register it for a resource request. | 3427 // Register it for a resource request. |
| 3428 auto downloaded_file = | 3428 auto downloaded_file = |
| 3429 DownloadedTempFileImpl::Create(filter_->child_id(), kRequestID); | 3429 DownloadedTempFileImpl::CreateForTesting(filter_->child_id(), kRequestID); |
| 3430 mojom::DownloadedTempFilePtr downloaded_file_ptr = | 3430 mojom::DownloadedTempFilePtr downloaded_file_ptr = |
| 3431 DownloadedTempFileImpl::Create(filter_->child_id(), kRequestID); | 3431 DownloadedTempFileImpl::CreateForTesting(filter_->child_id(), kRequestID); |
| 3432 host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path); | 3432 host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path); |
| 3433 | 3433 |
| 3434 // Should be readable now. | 3434 // Should be readable now. |
| 3435 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 3435 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
| 3436 filter_->child_id(), file_path)); | 3436 filter_->child_id(), file_path)); |
| 3437 | 3437 |
| 3438 // The child releases from the request. | 3438 // The child releases from the request. |
| 3439 downloaded_file_ptr = nullptr; | 3439 downloaded_file_ptr = nullptr; |
| 3440 base::RunLoop().RunUntilIdle(); | 3440 base::RunLoop().RunUntilIdle(); |
| 3441 | 3441 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3989 return nullptr; | 3989 return nullptr; |
| 3990 } | 3990 } |
| 3991 | 3991 |
| 3992 INSTANTIATE_TEST_CASE_P( | 3992 INSTANTIATE_TEST_CASE_P( |
| 3993 ResourceDispatcherHostTests, | 3993 ResourceDispatcherHostTests, |
| 3994 ResourceDispatcherHostTest, | 3994 ResourceDispatcherHostTest, |
| 3995 testing::Values(TestConfig::kDefault, | 3995 testing::Values(TestConfig::kDefault, |
| 3996 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 3996 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
| 3997 | 3997 |
| 3998 } // namespace content | 3998 } // namespace content |
| OLD | NEW |