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

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

Issue 1952423002: JobController 2: Remove reference between HttpStreamFactoryImpl::Jobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Job_Controller_1
Patch Set: fix a include typo Created 4 years, 4 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 "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
16 16
17 using testing::_;
18 using testing::Invoke;
19
17 namespace net { 20 namespace net {
18 21
19 class HttpStreamFactoryImplPeer { 22 class HttpStreamFactoryImplPeer {
20 public: 23 public:
21 static void AddJobController( 24 static void AddJobController(
22 HttpStreamFactoryImpl* factory, 25 HttpStreamFactoryImpl* factory,
23 HttpStreamFactoryImpl::JobController* job_controller) { 26 HttpStreamFactoryImpl::JobController* job_controller) {
24 factory->job_controller_set_.insert(base::WrapUnique(job_controller)); 27 factory->job_controller_set_.insert(base::WrapUnique(job_controller));
25 } 28 }
26 29
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 RequestPriority priority, 109 RequestPriority priority,
107 const SSLConfig& server_ssl_config, 110 const SSLConfig& server_ssl_config,
108 const SSLConfig& proxy_ssl_config, 111 const SSLConfig& proxy_ssl_config,
109 HostPortPair destination, 112 HostPortPair destination,
110 GURL origin_url, 113 GURL origin_url,
111 AlternativeService alternative_service, 114 AlternativeService alternative_service,
112 NetLog* net_log); 115 NetLog* net_log);
113 116
114 ~MockHttpStreamFactoryImplJob() override; 117 ~MockHttpStreamFactoryImplJob() override;
115 118
116 MOCK_METHOD1(Start, void(HttpStreamRequest::StreamType stream_type)); 119 MOCK_METHOD0(Resume, void());
117 120
118 MOCK_METHOD1(MarkOtherJobComplete, void(const Job& job)); 121 MOCK_METHOD1(MarkOtherJobComplete, void(const Job& job));
119 122
120 MOCK_METHOD0(Orphan, void()); 123 MOCK_METHOD0(Orphan, void());
121 }; 124 };
122 125
123 // JobFactory for creating MockHttpStreamFactoryImplJobs. 126 // JobFactory for creating MockHttpStreamFactoryImplJobs.
124 class TestJobFactory : public HttpStreamFactoryImpl::JobFactory { 127 class TestJobFactory : public HttpStreamFactoryImpl::JobFactory {
125 public: 128 public:
126 TestJobFactory(); 129 TestJobFactory();
(...skipping 22 matching lines...) Expand all
149 HostPortPair destination, 152 HostPortPair destination,
150 GURL origin_url, 153 GURL origin_url,
151 AlternativeService alternative_service, 154 AlternativeService alternative_service,
152 NetLog* net_log) override; 155 NetLog* net_log) override;
153 156
154 MockHttpStreamFactoryImplJob* main_job() const { return main_job_; } 157 MockHttpStreamFactoryImplJob* main_job() const { return main_job_; }
155 MockHttpStreamFactoryImplJob* alternative_job() const { 158 MockHttpStreamFactoryImplJob* alternative_job() const {
156 return alternative_job_; 159 return alternative_job_;
157 } 160 }
158 161
162 void UseDifferentURLForMainJob(GURL url) {
163 override_main_job_url_ = true;
164 main_job_alternative_url_ = url;
165 }
166
159 private: 167 private:
160 MockHttpStreamFactoryImplJob* main_job_; 168 MockHttpStreamFactoryImplJob* main_job_;
161 MockHttpStreamFactoryImplJob* alternative_job_; 169 MockHttpStreamFactoryImplJob* alternative_job_;
170 bool override_main_job_url_;
171 GURL main_job_alternative_url_;
162 }; 172 };
163 173
164 } // namespace net 174 } // namespace net
165 175
166 #endif // NET_HTTP_HTTP_STREAM_FACTORY_TEST_UTIL_H_ 176 #endif // NET_HTTP_HTTP_STREAM_FACTORY_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_request_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