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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() { | 712 DownloadManagerDelegate* TestingProfile::GetDownloadManagerDelegate() { |
713 return NULL; | 713 return NULL; |
714 } | 714 } |
715 | 715 |
716 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { | 716 net::URLRequestContextGetter* TestingProfile::GetRequestContext() { |
717 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 717 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
718 } | 718 } |
719 | 719 |
720 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( | 720 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( |
721 content::ProtocolHandlerMap* protocol_handlers, | 721 content::ProtocolHandlerMap* protocol_handlers, |
722 content::ProtocolHandlerScopedVector protocol_interceptors) { | 722 content::URLRequestInterceptorScopedVector request_interceptors) { |
723 return new net::TestURLRequestContextGetter( | 723 return new net::TestURLRequestContextGetter( |
724 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 724 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
725 } | 725 } |
726 | 726 |
727 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( | 727 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( |
728 int renderer_child_id) { | 728 int renderer_child_id) { |
729 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 729 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
730 renderer_child_id); | 730 renderer_child_id); |
731 return rph->GetStoragePartition()->GetURLRequestContext(); | 731 return rph->GetStoragePartition()->GetURLRequestContext(); |
732 } | 732 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 if (!GetRequestContext()) | 791 if (!GetRequestContext()) |
792 return NULL; | 792 return NULL; |
793 return GetRequestContext()->GetURLRequestContext()->ssl_config_service(); | 793 return GetRequestContext()->GetURLRequestContext()->ssl_config_service(); |
794 } | 794 } |
795 | 795 |
796 net::URLRequestContextGetter* | 796 net::URLRequestContextGetter* |
797 TestingProfile::CreateRequestContextForStoragePartition( | 797 TestingProfile::CreateRequestContextForStoragePartition( |
798 const base::FilePath& partition_path, | 798 const base::FilePath& partition_path, |
799 bool in_memory, | 799 bool in_memory, |
800 content::ProtocolHandlerMap* protocol_handlers, | 800 content::ProtocolHandlerMap* protocol_handlers, |
801 content::ProtocolHandlerScopedVector protocol_interceptors) { | 801 content::URLRequestInterceptorScopedVector request_interceptors) { |
802 // We don't test storage partitions here yet, so returning the same dummy | 802 // We don't test storage partitions here yet, so returning the same dummy |
803 // context is sufficient for now. | 803 // context is sufficient for now. |
804 return GetRequestContext(); | 804 return GetRequestContext(); |
805 } | 805 } |
806 | 806 |
807 content::ResourceContext* TestingProfile::GetResourceContext() { | 807 content::ResourceContext* TestingProfile::GetResourceContext() { |
808 if (!resource_context_) | 808 if (!resource_context_) |
809 resource_context_ = new content::MockResourceContext(); | 809 resource_context_ = new content::MockResourceContext(); |
810 return resource_context_; | 810 return resource_context_; |
811 } | 811 } |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 path_, | 972 path_, |
973 delegate_, | 973 delegate_, |
974 extension_policy_, | 974 extension_policy_, |
975 pref_service_.Pass(), | 975 pref_service_.Pass(), |
976 incognito_, | 976 incognito_, |
977 guest_session_, | 977 guest_session_, |
978 managed_user_id_, | 978 managed_user_id_, |
979 policy_service_.Pass(), | 979 policy_service_.Pass(), |
980 testing_factories_)); | 980 testing_factories_)); |
981 } | 981 } |
OLD | NEW |