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

Side by Side Diff: net/http/http_stream_factory_test_util.h

Issue 2260623002: Race TCP connection to proxies with QUIC connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fix Created 4 years, 3 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) 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_TEST_UTIL_H_ 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_TEST_UTIL_H_
6 #define NET_HTTP_HTTP_STREAM_FACTORY_TEST_UTIL_H_ 6 #define NET_HTTP_HTTP_STREAM_FACTORY_TEST_UTIL_H_
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "net/http/http_stream.h" 9 #include "net/http/http_stream.h"
10 #include "net/http/http_stream_factory.h" 10 #include "net/http/http_stream_factory.h"
11 #include "net/http/http_stream_factory_impl.h" 11 #include "net/http/http_stream_factory_impl.h"
12 #include "net/http/http_stream_factory_impl_job.h" 12 #include "net/http/http_stream_factory_impl_job.h"
13 #include "net/http/http_stream_factory_impl_job_controller.h" 13 #include "net/http/http_stream_factory_impl_job_controller.h"
14 #include "net/proxy/proxy_info.h" 14 #include "net/proxy/proxy_info.h"
15 #include "net/proxy/proxy_server.h"
15 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
16 17
17 using testing::_; 18 using testing::_;
18 using testing::Invoke; 19 using testing::Invoke;
19 20
20 namespace net { 21 namespace net {
21 22
22 class HttpStreamFactoryImplPeer { 23 class HttpStreamFactoryImplPeer {
23 public: 24 public:
24 static void AddJobController( 25 static void AddJobController(
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 MockHttpStreamFactoryImplJob(HttpStreamFactoryImpl::Job::Delegate* delegate, 106 MockHttpStreamFactoryImplJob(HttpStreamFactoryImpl::Job::Delegate* delegate,
106 HttpStreamFactoryImpl::JobType job_type, 107 HttpStreamFactoryImpl::JobType job_type,
107 HttpNetworkSession* session, 108 HttpNetworkSession* session,
108 const HttpRequestInfo& request_info, 109 const HttpRequestInfo& request_info,
109 RequestPriority priority, 110 RequestPriority priority,
110 const SSLConfig& server_ssl_config, 111 const SSLConfig& server_ssl_config,
111 const SSLConfig& proxy_ssl_config, 112 const SSLConfig& proxy_ssl_config,
112 HostPortPair destination, 113 HostPortPair destination,
113 GURL origin_url, 114 GURL origin_url,
114 AlternativeService alternative_service, 115 AlternativeService alternative_service,
116 const ProxyServer& alternative_proxy_server,
115 NetLog* net_log); 117 NetLog* net_log);
116 118
117 ~MockHttpStreamFactoryImplJob() override; 119 ~MockHttpStreamFactoryImplJob() override;
118 120
119 MOCK_METHOD0(Resume, void()); 121 MOCK_METHOD0(Resume, void());
120 122
121 MOCK_METHOD1(MarkOtherJobComplete, void(const Job& job)); 123 MOCK_METHOD1(MarkOtherJobComplete, void(const Job& job));
122 124
123 MOCK_METHOD0(Orphan, void()); 125 MOCK_METHOD0(Orphan, void());
124 }; 126 };
(...skipping 22 matching lines...) Expand all
147 HttpNetworkSession* session, 149 HttpNetworkSession* session,
148 const HttpRequestInfo& request_info, 150 const HttpRequestInfo& request_info,
149 RequestPriority priority, 151 RequestPriority priority,
150 const SSLConfig& server_ssl_config, 152 const SSLConfig& server_ssl_config,
151 const SSLConfig& proxy_ssl_config, 153 const SSLConfig& proxy_ssl_config,
152 HostPortPair destination, 154 HostPortPair destination,
153 GURL origin_url, 155 GURL origin_url,
154 AlternativeService alternative_service, 156 AlternativeService alternative_service,
155 NetLog* net_log) override; 157 NetLog* net_log) override;
156 158
159 HttpStreamFactoryImpl::Job* CreateJob(
160 HttpStreamFactoryImpl::Job::Delegate* delegate,
161 HttpStreamFactoryImpl::JobType job_type,
162 HttpNetworkSession* session,
163 const HttpRequestInfo& request_info,
164 RequestPriority priority,
165 const SSLConfig& server_ssl_config,
166 const SSLConfig& proxy_ssl_config,
167 HostPortPair destination,
168 GURL origin_url,
169 const ProxyServer& alternative_proxy_server,
170 NetLog* net_log) override;
171
157 MockHttpStreamFactoryImplJob* main_job() const { return main_job_; } 172 MockHttpStreamFactoryImplJob* main_job() const { return main_job_; }
158 MockHttpStreamFactoryImplJob* alternative_job() const { 173 MockHttpStreamFactoryImplJob* alternative_job() const {
159 return alternative_job_; 174 return alternative_job_;
160 } 175 }
161 176
162 void UseDifferentURLForMainJob(GURL url) { 177 void UseDifferentURLForMainJob(GURL url) {
163 override_main_job_url_ = true; 178 override_main_job_url_ = true;
164 main_job_alternative_url_ = url; 179 main_job_alternative_url_ = url;
165 } 180 }
166 181
167 private: 182 private:
168 MockHttpStreamFactoryImplJob* main_job_; 183 MockHttpStreamFactoryImplJob* main_job_;
169 MockHttpStreamFactoryImplJob* alternative_job_; 184 MockHttpStreamFactoryImplJob* alternative_job_;
170 bool override_main_job_url_; 185 bool override_main_job_url_;
171 GURL main_job_alternative_url_; 186 GURL main_job_alternative_url_;
172 }; 187 };
173 188
174 } // namespace net 189 } // namespace net
175 190
176 #endif // NET_HTTP_HTTP_STREAM_FACTORY_TEST_UTIL_H_ 191 #endif // NET_HTTP_HTTP_STREAM_FACTORY_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/http/http_stream_factory_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698