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