| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "net/http/http_stream_factory_test_util.h" |
| 6 |
| 7 #include "net/proxy/proxy_info.h" |
| 8 |
| 9 using ::testing::_; |
| 10 |
| 11 namespace net { |
| 12 MockHttpStreamRequestDelegate::MockHttpStreamRequestDelegate() {} |
| 13 |
| 14 MockHttpStreamRequestDelegate::~MockHttpStreamRequestDelegate() {} |
| 15 |
| 16 TestHttpStreamFactoryImplJob::TestHttpStreamFactoryImplJob( |
| 17 HttpStreamFactoryImpl::Job::Delegate* delegate, |
| 18 HttpStreamFactoryImpl::JobType job_type, |
| 19 HttpNetworkSession* session, |
| 20 const HttpRequestInfo& request_info, |
| 21 RequestPriority priority, |
| 22 const SSLConfig& server_ssl_config, |
| 23 const SSLConfig& proxy_ssl_config, |
| 24 HostPortPair destination, |
| 25 GURL origin_url, |
| 26 NetLog* net_log) |
| 27 : HttpStreamFactoryImpl::Job(delegate, |
| 28 job_type, |
| 29 session, |
| 30 request_info, |
| 31 priority, |
| 32 server_ssl_config, |
| 33 proxy_ssl_config, |
| 34 destination, |
| 35 origin_url, |
| 36 net_log) {} |
| 37 |
| 38 TestHttpStreamFactoryImplJob::TestHttpStreamFactoryImplJob( |
| 39 HttpStreamFactoryImpl::Job::Delegate* delegate, |
| 40 HttpStreamFactoryImpl::JobType job_type, |
| 41 HttpNetworkSession* session, |
| 42 const HttpRequestInfo& request_info, |
| 43 RequestPriority priority, |
| 44 const SSLConfig& server_ssl_config, |
| 45 const SSLConfig& proxy_ssl_config, |
| 46 HostPortPair destination, |
| 47 GURL origin_url, |
| 48 AlternativeService alternative_service, |
| 49 NetLog* net_log) |
| 50 : HttpStreamFactoryImpl::Job(delegate, |
| 51 job_type, |
| 52 session, |
| 53 request_info, |
| 54 priority, |
| 55 server_ssl_config, |
| 56 proxy_ssl_config, |
| 57 destination, |
| 58 origin_url, |
| 59 alternative_service, |
| 60 net_log) {} |
| 61 |
| 62 TestHttpStreamFactoryImplJob::~TestHttpStreamFactoryImplJob() {} |
| 63 |
| 64 TestJobFactory::TestJobFactory() |
| 65 : main_job_(nullptr), alternative_job_(nullptr) {} |
| 66 |
| 67 TestJobFactory::~TestJobFactory() {} |
| 68 |
| 69 HttpStreamFactoryImpl::Job* TestJobFactory::CreateJob( |
| 70 HttpStreamFactoryImpl::Job::Delegate* delegate, |
| 71 HttpStreamFactoryImpl::JobType job_type, |
| 72 HttpNetworkSession* session, |
| 73 const HttpRequestInfo& request_info, |
| 74 RequestPriority priority, |
| 75 const SSLConfig& server_ssl_config, |
| 76 const SSLConfig& proxy_ssl_config, |
| 77 HostPortPair destination, |
| 78 GURL origin_url, |
| 79 NetLog* net_log) { |
| 80 DCHECK(!main_job_); |
| 81 main_job_ = new TestHttpStreamFactoryImplJob( |
| 82 delegate, job_type, session, request_info, priority, SSLConfig(), |
| 83 SSLConfig(), destination, origin_url, nullptr); |
| 84 |
| 85 EXPECT_CALL(*main_job_, Start(_)).Times(1); |
| 86 |
| 87 return main_job_; |
| 88 } |
| 89 |
| 90 HttpStreamFactoryImpl::Job* TestJobFactory::CreateJob( |
| 91 HttpStreamFactoryImpl::Job::Delegate* delegate, |
| 92 HttpStreamFactoryImpl::JobType job_type, |
| 93 HttpNetworkSession* session, |
| 94 const HttpRequestInfo& request_info, |
| 95 RequestPriority priority, |
| 96 const SSLConfig& server_ssl_config, |
| 97 const SSLConfig& proxy_ssl_config, |
| 98 HostPortPair destination, |
| 99 GURL origin_url, |
| 100 AlternativeService alternative_service, |
| 101 NetLog* net_log) { |
| 102 DCHECK(!alternative_job_); |
| 103 alternative_job_ = new TestHttpStreamFactoryImplJob( |
| 104 delegate, job_type, session, request_info, priority, SSLConfig(), |
| 105 SSLConfig(), destination, origin_url, alternative_service, nullptr); |
| 106 |
| 107 EXPECT_CALL(*alternative_job_, Start(_)).Times(1); |
| 108 |
| 109 return alternative_job_; |
| 110 } |
| 111 |
| 112 } // namespace net |
| OLD | NEW |