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 3410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3421 ShareableFileReference::GetOrCreate( | 3421 ShareableFileReference::GetOrCreate( |
3422 file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, | 3422 file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, |
3423 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); | 3423 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); |
3424 | 3424 |
3425 // Not readable. | 3425 // Not readable. |
3426 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 3426 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
3427 filter_->child_id(), file_path)); | 3427 filter_->child_id(), file_path)); |
3428 | 3428 |
3429 // Register it for a resource request. | 3429 // Register it for a resource request. |
3430 auto downloaded_file = | 3430 auto downloaded_file = |
3431 DownloadedTempFileImpl::CreateForTesting(filter_->child_id(), kRequestID); | 3431 DownloadedTempFileImpl::Create(filter_->child_id(), kRequestID); |
3432 mojom::DownloadedTempFilePtr downloaded_file_ptr = | 3432 mojom::DownloadedTempFilePtr downloaded_file_ptr = |
3433 DownloadedTempFileImpl::CreateForTesting(filter_->child_id(), kRequestID); | 3433 DownloadedTempFileImpl::Create(filter_->child_id(), kRequestID); |
3434 host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path); | 3434 host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path); |
3435 | 3435 |
3436 // Should be readable now. | 3436 // Should be readable now. |
3437 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 3437 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
3438 filter_->child_id(), file_path)); | 3438 filter_->child_id(), file_path)); |
3439 | 3439 |
3440 // The child releases from the request. | 3440 // The child releases from the request. |
3441 downloaded_file_ptr = nullptr; | 3441 downloaded_file_ptr = nullptr; |
3442 base::RunLoop().RunUntilIdle(); | 3442 base::RunLoop().RunUntilIdle(); |
3443 | 3443 |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3991 return nullptr; | 3991 return nullptr; |
3992 } | 3992 } |
3993 | 3993 |
3994 INSTANTIATE_TEST_CASE_P( | 3994 INSTANTIATE_TEST_CASE_P( |
3995 ResourceDispatcherHostTests, | 3995 ResourceDispatcherHostTests, |
3996 ResourceDispatcherHostTest, | 3996 ResourceDispatcherHostTest, |
3997 testing::Values(TestConfig::kDefault, | 3997 testing::Values(TestConfig::kDefault, |
3998 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 3998 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
3999 | 3999 |
4000 } // namespace content | 4000 } // namespace content |
OLD | NEW |