Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1014)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 2561743003: Use associated interface on DownloadedTempFile (Closed)
Patch Set: update LayoutTest/TestExpectations Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3407 matching lines...) Expand 10 before | Expand all | Expand 10 after
3418 ShareableFileReference::GetOrCreate( 3418 ShareableFileReference::GetOrCreate(
3419 file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, 3419 file_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE,
3420 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); 3420 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get());
3421 3421
3422 // Not readable. 3422 // Not readable.
3423 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( 3423 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(
3424 filter_->child_id(), file_path)); 3424 filter_->child_id(), file_path));
3425 3425
3426 // Register it for a resource request. 3426 // Register it for a resource request.
3427 auto downloaded_file = 3427 auto downloaded_file =
3428 DownloadedTempFileImpl::Create(filter_->child_id(), kRequestID); 3428 DownloadedTempFileImpl::CreateForTesting(filter_->child_id(), kRequestID);
3429 mojom::DownloadedTempFilePtr downloaded_file_ptr = 3429 mojom::DownloadedTempFilePtr downloaded_file_ptr =
3430 DownloadedTempFileImpl::Create(filter_->child_id(), kRequestID); 3430 DownloadedTempFileImpl::CreateForTesting(filter_->child_id(), kRequestID);
3431 host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path); 3431 host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path);
3432 3432
3433 // Should be readable now. 3433 // Should be readable now.
3434 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( 3434 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(
3435 filter_->child_id(), file_path)); 3435 filter_->child_id(), file_path));
3436 3436
3437 // The child releases from the request. 3437 // The child releases from the request.
3438 downloaded_file_ptr = nullptr; 3438 downloaded_file_ptr = nullptr;
3439 base::RunLoop().RunUntilIdle(); 3439 base::RunLoop().RunUntilIdle();
3440 3440
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
3988 return nullptr; 3988 return nullptr;
3989 } 3989 }
3990 3990
3991 INSTANTIATE_TEST_CASE_P( 3991 INSTANTIATE_TEST_CASE_P(
3992 ResourceDispatcherHostTests, 3992 ResourceDispatcherHostTests,
3993 ResourceDispatcherHostTest, 3993 ResourceDispatcherHostTest,
3994 testing::Values(TestConfig::kDefault, 3994 testing::Values(TestConfig::kDefault,
3995 TestConfig::kOptimizeIPCForSmallResourceEnabled)); 3995 TestConfig::kOptimizeIPCForSmallResourceEnabled));
3996 3996
3997 } // namespace content 3997 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698