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

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

Issue 2108643004: Remove use of WebContentsImpl from ResourceDispatcherHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@render-view-try-3
Patch Set: fixes Created 4 years, 5 months 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 15 matching lines...) Expand all
26 #include "content/browser/cert_store_impl.h" 26 #include "content/browser/cert_store_impl.h"
27 #include "content/browser/child_process_security_policy_impl.h" 27 #include "content/browser/child_process_security_policy_impl.h"
28 #include "content/browser/frame_host/navigation_request_info.h" 28 #include "content/browser/frame_host/navigation_request_info.h"
29 #include "content/browser/loader/cross_site_resource_handler.h" 29 #include "content/browser/loader/cross_site_resource_handler.h"
30 #include "content/browser/loader/detachable_resource_handler.h" 30 #include "content/browser/loader/detachable_resource_handler.h"
31 #include "content/browser/loader/navigation_url_loader.h" 31 #include "content/browser/loader/navigation_url_loader.h"
32 #include "content/browser/loader/resource_dispatcher_host_impl.h" 32 #include "content/browser/loader/resource_dispatcher_host_impl.h"
33 #include "content/browser/loader/resource_loader.h" 33 #include "content/browser/loader/resource_loader.h"
34 #include "content/browser/loader/resource_message_filter.h" 34 #include "content/browser/loader/resource_message_filter.h"
35 #include "content/browser/loader/resource_request_info_impl.h" 35 #include "content/browser/loader/resource_request_info_impl.h"
36 #include "content/browser/loader_delegate_impl.h"
36 #include "content/common/appcache_interfaces.h" 37 #include "content/common/appcache_interfaces.h"
37 #include "content/common/child_process_host_impl.h" 38 #include "content/common/child_process_host_impl.h"
38 #include "content/common/navigation_params.h" 39 #include "content/common/navigation_params.h"
39 #include "content/common/resource_messages.h" 40 #include "content/common/resource_messages.h"
40 #include "content/common/resource_request.h" 41 #include "content/common/resource_request.h"
41 #include "content/common/ssl_status_serialization.h" 42 #include "content/common/ssl_status_serialization.h"
42 #include "content/common/view_messages.h" 43 #include "content/common/view_messages.h"
43 #include "content/public/browser/global_request_id.h" 44 #include "content/public/browser/global_request_id.h"
44 #include "content/public/browser/render_process_host.h" 45 #include "content/public/browser/render_process_host.h"
45 #include "content/public/browser/resource_context.h" 46 #include "content/public/browser/resource_context.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 public IPC::Sender { 892 public IPC::Sender {
892 public: 893 public:
893 typedef ResourceDispatcherHostImpl::LoadInfo LoadInfo; 894 typedef ResourceDispatcherHostImpl::LoadInfo LoadInfo;
894 typedef ResourceDispatcherHostImpl::LoadInfoMap LoadInfoMap; 895 typedef ResourceDispatcherHostImpl::LoadInfoMap LoadInfoMap;
895 896
896 ResourceDispatcherHostTest() 897 ResourceDispatcherHostTest()
897 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), 898 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
898 use_test_ssl_certificate_(false), 899 use_test_ssl_certificate_(false),
899 send_data_received_acks_(false), 900 send_data_received_acks_(false),
900 auto_advance_(false) { 901 auto_advance_(false) {
902 host_.SetLoaderDelegate(&loader_delegate_);
901 browser_context_.reset(new TestBrowserContext()); 903 browser_context_.reset(new TestBrowserContext());
902 BrowserContext::EnsureResourceContextInitialized(browser_context_.get()); 904 BrowserContext::EnsureResourceContextInitialized(browser_context_.get());
903 base::RunLoop().RunUntilIdle(); 905 base::RunLoop().RunUntilIdle();
904 filter_ = MakeForwardingFilter(); 906 filter_ = MakeForwardingFilter();
905 // TODO(cbentzel): Better way to get URLRequestContext? 907 // TODO(cbentzel): Better way to get URLRequestContext?
906 net::URLRequestContext* request_context = 908 net::URLRequestContext* request_context =
907 browser_context_->GetResourceContext()->GetRequestContext(); 909 browser_context_->GetResourceContext()->GetRequestContext();
908 job_factory_.reset(new TestURLRequestJobFactory(this)); 910 job_factory_.reset(new TestURLRequestJobFactory(this));
909 request_context->set_job_factory(job_factory_.get()); 911 request_context->set_job_factory(job_factory_.get());
910 request_context->set_network_delegate(&network_delegate_); 912 request_context->set_network_delegate(&network_delegate_);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 std::unique_ptr<base::RunLoop> wait_for_request_create_loop_; 1182 std::unique_ptr<base::RunLoop> wait_for_request_create_loop_;
1181 1183
1182 content::TestBrowserThreadBundle thread_bundle_; 1184 content::TestBrowserThreadBundle thread_bundle_;
1183 std::unique_ptr<TestBrowserContext> browser_context_; 1185 std::unique_ptr<TestBrowserContext> browser_context_;
1184 std::unique_ptr<TestURLRequestJobFactory> job_factory_; 1186 std::unique_ptr<TestURLRequestJobFactory> job_factory_;
1185 std::unique_ptr<WebContents> web_contents_; 1187 std::unique_ptr<WebContents> web_contents_;
1186 std::unique_ptr<TestWebContentsObserver> web_contents_observer_; 1188 std::unique_ptr<TestWebContentsObserver> web_contents_observer_;
1187 scoped_refptr<ForwardingFilter> filter_; 1189 scoped_refptr<ForwardingFilter> filter_;
1188 scoped_refptr<TestFilterSpecifyingChild> web_contents_filter_; 1190 scoped_refptr<TestFilterSpecifyingChild> web_contents_filter_;
1189 net::TestNetworkDelegate network_delegate_; 1191 net::TestNetworkDelegate network_delegate_;
1192 LoaderDelegateImpl loader_delegate_;
1190 ResourceDispatcherHostImpl host_; 1193 ResourceDispatcherHostImpl host_;
1191 ResourceIPCAccumulator accum_; 1194 ResourceIPCAccumulator accum_;
1192 std::string response_headers_; 1195 std::string response_headers_;
1193 std::string response_data_; 1196 std::string response_data_;
1194 bool use_test_ssl_certificate_; 1197 bool use_test_ssl_certificate_;
1195 std::string scheme_; 1198 std::string scheme_;
1196 bool send_data_received_acks_; 1199 bool send_data_received_acks_;
1197 std::set<int> child_ids_; 1200 std::set<int> child_ids_;
1198 std::unique_ptr<base::RunLoop> wait_for_request_complete_loop_; 1201 std::unique_ptr<base::RunLoop> wait_for_request_complete_loop_;
1199 RenderViewHostTestEnabler render_view_host_test_enabler_; 1202 RenderViewHostTestEnabler render_view_host_test_enabler_;
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after
3896 return nullptr; 3899 return nullptr;
3897 } 3900 }
3898 3901
3899 INSTANTIATE_TEST_CASE_P( 3902 INSTANTIATE_TEST_CASE_P(
3900 ResourceDispatcherHostTests, 3903 ResourceDispatcherHostTests,
3901 ResourceDispatcherHostTest, 3904 ResourceDispatcherHostTest,
3902 testing::Values(TestConfig::kDefault, 3905 testing::Values(TestConfig::kDefault,
3903 TestConfig::kOptimizeIPCForSmallResourceEnabled)); 3906 TestConfig::kOptimizeIPCForSmallResourceEnabled));
3904 3907
3905 } // namespace content 3908 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698