| 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 "chrome/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 | 576 |
| 577 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() { | 577 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() { |
| 578 return NULL; | 578 return NULL; |
| 579 } | 579 } |
| 580 | 580 |
| 581 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { | 581 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { |
| 582 return request_context_.get(); | 582 return request_context_.get(); |
| 583 } | 583 } |
| 584 | 584 |
| 585 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( | 585 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( |
| 586 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 586 content::ProtocolHandlerMap* protocol_handlers) { |
| 587 blob_protocol_handler, | |
| 588 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 589 file_system_protocol_handler, | |
| 590 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 591 developer_protocol_handler, | |
| 592 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 593 chrome_protocol_handler, | |
| 594 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 595 chrome_devtools_protocol_handler) { | |
| 596 return request_context_.get(); | 587 return request_context_.get(); |
| 597 } | 588 } |
| 598 | 589 |
| 599 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( | 590 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( |
| 600 int renderer_child_id) { | 591 int renderer_child_id) { |
| 601 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 592 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
| 602 renderer_child_id); | 593 renderer_child_id); |
| 603 return rph->GetStoragePartition()->GetURLRequestContext(); | 594 return rph->GetStoragePartition()->GetURLRequestContext(); |
| 604 } | 595 } |
| 605 | 596 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 net::SSLConfigService* TestingProfile::GetSSLConfigService() { | 635 net::SSLConfigService* TestingProfile::GetSSLConfigService() { |
| 645 if (!GetRequestContext()) | 636 if (!GetRequestContext()) |
| 646 return NULL; | 637 return NULL; |
| 647 return GetRequestContext()->GetURLRequestContext()->ssl_config_service(); | 638 return GetRequestContext()->GetURLRequestContext()->ssl_config_service(); |
| 648 } | 639 } |
| 649 | 640 |
| 650 net::URLRequestContextGetter* | 641 net::URLRequestContextGetter* |
| 651 TestingProfile::CreateRequestContextForStoragePartition( | 642 TestingProfile::CreateRequestContextForStoragePartition( |
| 652 const base::FilePath& partition_path, | 643 const base::FilePath& partition_path, |
| 653 bool in_memory, | 644 bool in_memory, |
| 654 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 645 content::ProtocolHandlerMap* protocol_handlers) { |
| 655 blob_protocol_handler, | |
| 656 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 657 file_system_protocol_handler, | |
| 658 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 659 developer_protocol_handler, | |
| 660 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 661 chrome_protocol_handler, | |
| 662 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 663 chrome_devtools_protocol_handler) { | |
| 664 // We don't test storage partitions here yet, so returning the same dummy | 646 // We don't test storage partitions here yet, so returning the same dummy |
| 665 // context is sufficient for now. | 647 // context is sufficient for now. |
| 666 return GetRequestContext(); | 648 return GetRequestContext(); |
| 667 } | 649 } |
| 668 | 650 |
| 669 content::ResourceContext* TestingProfile::GetResourceContext() { | 651 content::ResourceContext* TestingProfile::GetResourceContext() { |
| 670 if (!resource_context_.get()) | 652 if (!resource_context_.get()) |
| 671 resource_context_.reset(new content::MockResourceContext()); | 653 resource_context_.reset(new content::MockResourceContext()); |
| 672 return resource_context_.get(); | 654 return resource_context_.get(); |
| 673 } | 655 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 | 791 |
| 810 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 792 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 811 DCHECK(!build_called_); | 793 DCHECK(!build_called_); |
| 812 build_called_ = true; | 794 build_called_ = true; |
| 813 return scoped_ptr<TestingProfile>(new TestingProfile( | 795 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 814 path_, | 796 path_, |
| 815 delegate_, | 797 delegate_, |
| 816 extension_policy_, | 798 extension_policy_, |
| 817 pref_service_.Pass())); | 799 pref_service_.Pass())); |
| 818 } | 800 } |
| OLD | NEW |