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 <stddef.h> | 5 #include <stddef.h> |
6 #include <utility> | 6 #include <utility> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 | 886 |
887 class ResourceDispatcherHostTest : public testing::TestWithParam<TestConfig>, | 887 class ResourceDispatcherHostTest : public testing::TestWithParam<TestConfig>, |
888 public IPC::Sender { | 888 public IPC::Sender { |
889 public: | 889 public: |
890 typedef ResourceDispatcherHostImpl::LoadInfo LoadInfo; | 890 typedef ResourceDispatcherHostImpl::LoadInfo LoadInfo; |
891 typedef ResourceDispatcherHostImpl::LoadInfoMap LoadInfoMap; | 891 typedef ResourceDispatcherHostImpl::LoadInfoMap LoadInfoMap; |
892 | 892 |
893 ResourceDispatcherHostTest() | 893 ResourceDispatcherHostTest() |
894 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), | 894 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
895 use_test_ssl_certificate_(false), | 895 use_test_ssl_certificate_(false), |
896 old_factory_(NULL), | |
897 send_data_received_acks_(false), | 896 send_data_received_acks_(false), |
898 auto_advance_(false) { | 897 auto_advance_(false) { |
899 browser_context_.reset(new TestBrowserContext()); | 898 browser_context_.reset(new TestBrowserContext()); |
900 BrowserContext::EnsureResourceContextInitialized(browser_context_.get()); | 899 BrowserContext::EnsureResourceContextInitialized(browser_context_.get()); |
901 base::RunLoop().RunUntilIdle(); | 900 base::RunLoop().RunUntilIdle(); |
902 filter_ = MakeForwardingFilter(); | 901 filter_ = MakeForwardingFilter(); |
903 // TODO(cbentzel): Better way to get URLRequestContext? | 902 // TODO(cbentzel): Better way to get URLRequestContext? |
904 net::URLRequestContext* request_context = | 903 net::URLRequestContext* request_context = |
905 browser_context_->GetResourceContext()->GetRequestContext(); | 904 browser_context_->GetResourceContext()->GetRequestContext(); |
906 job_factory_.reset(new TestURLRequestJobFactory(this)); | 905 job_factory_.reset(new TestURLRequestJobFactory(this)); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 std::unique_ptr<TestWebContentsObserver> web_contents_observer_; | 1181 std::unique_ptr<TestWebContentsObserver> web_contents_observer_; |
1183 scoped_refptr<ForwardingFilter> filter_; | 1182 scoped_refptr<ForwardingFilter> filter_; |
1184 scoped_refptr<TestFilterSpecifyingChild> web_contents_filter_; | 1183 scoped_refptr<TestFilterSpecifyingChild> web_contents_filter_; |
1185 net::TestNetworkDelegate network_delegate_; | 1184 net::TestNetworkDelegate network_delegate_; |
1186 ResourceDispatcherHostImpl host_; | 1185 ResourceDispatcherHostImpl host_; |
1187 ResourceIPCAccumulator accum_; | 1186 ResourceIPCAccumulator accum_; |
1188 std::string response_headers_; | 1187 std::string response_headers_; |
1189 std::string response_data_; | 1188 std::string response_data_; |
1190 bool use_test_ssl_certificate_; | 1189 bool use_test_ssl_certificate_; |
1191 std::string scheme_; | 1190 std::string scheme_; |
1192 net::URLRequest::ProtocolFactory* old_factory_; | |
1193 bool send_data_received_acks_; | 1191 bool send_data_received_acks_; |
1194 std::set<int> child_ids_; | 1192 std::set<int> child_ids_; |
1195 std::unique_ptr<base::RunLoop> wait_for_request_complete_loop_; | 1193 std::unique_ptr<base::RunLoop> wait_for_request_complete_loop_; |
1196 RenderViewHostTestEnabler render_view_host_test_enabler_; | 1194 RenderViewHostTestEnabler render_view_host_test_enabler_; |
1197 MockCertStore mock_cert_store_; | 1195 MockCertStore mock_cert_store_; |
1198 bool auto_advance_; | 1196 bool auto_advance_; |
1199 }; | 1197 }; |
1200 | 1198 |
1201 void ResourceDispatcherHostTest::MakeTestRequest(int render_view_id, | 1199 void ResourceDispatcherHostTest::MakeTestRequest(int render_view_id, |
1202 int request_id, | 1200 int request_id, |
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3900 return nullptr; | 3898 return nullptr; |
3901 } | 3899 } |
3902 | 3900 |
3903 INSTANTIATE_TEST_CASE_P( | 3901 INSTANTIATE_TEST_CASE_P( |
3904 ResourceDispatcherHostTests, | 3902 ResourceDispatcherHostTests, |
3905 ResourceDispatcherHostTest, | 3903 ResourceDispatcherHostTest, |
3906 testing::Values(TestConfig::kDefault, | 3904 testing::Values(TestConfig::kDefault, |
3907 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 3905 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
3908 | 3906 |
3909 } // namespace content | 3907 } // namespace content |
OLD | NEW |