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

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

Issue 1941083002: JobController 1: Adding a new class HttpStreamFactoryImpl::JobController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add JobFactory interface in JobController, remove JobControllerPeer Created 4 years, 6 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
(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 TestHttpStreamRequestDelegate::TestHttpStreamRequestDelegate() {}
13
14 TestHttpStreamRequestDelegate::~TestHttpStreamRequestDelegate() {}
15
16 TestJobFactory::TestJobFactory()
Ryan Hamilton 2016/06/06 17:57:31 I think the .h and .cc files are in a different or
Zhongyi Shi 2016/06/06 22:50:56 Done.
17 : main_job_(nullptr), alternative_job_(nullptr) {}
18
19 TestJobFactory::~TestJobFactory() {}
20
21 HttpStreamFactoryImpl::Job* TestJobFactory::CreateJob(
22 HttpStreamFactoryImpl::Job::Delegate* delegate,
23 HttpStreamFactoryImpl::JobType job_type,
24 HttpNetworkSession* session,
25 const HttpRequestInfo& request_info,
26 RequestPriority priority,
27 const SSLConfig& server_ssl_config,
28 const SSLConfig& proxy_ssl_config,
29 HostPortPair destination,
30 GURL origin_url,
31 NetLog* net_log) {
Ryan Hamilton 2016/06/06 17:57:32 DCHECK(!main_job_)?
Zhongyi Shi 2016/06/06 22:50:56 Done.
32 main_job_ = new TestHttpStreamFactoryImplJob(
33 delegate, job_type, session, request_info, priority, SSLConfig(),
34 SSLConfig(), destination, origin_url, nullptr);
35
36 EXPECT_CALL(*main_job_, Start(_)).Times(1);
37
38 return main_job_;
39 }
40
41 HttpStreamFactoryImpl::Job* TestJobFactory::CreateJob(
42 HttpStreamFactoryImpl::Job::Delegate* delegate,
43 HttpStreamFactoryImpl::JobType job_type,
44 HttpNetworkSession* session,
45 const HttpRequestInfo& request_info,
46 RequestPriority priority,
47 const SSLConfig& server_ssl_config,
48 const SSLConfig& proxy_ssl_config,
49 HostPortPair destination,
50 GURL origin_url,
51 AlternativeService alternative_service,
52 NetLog* net_log) {
53 alternative_job_ = new TestHttpStreamFactoryImplJob(
Ryan Hamilton 2016/06/06 17:57:32 DCHECK(!alternative_job_)?
Zhongyi Shi 2016/06/06 22:50:56 Done.
54 delegate, job_type, session, request_info, priority, SSLConfig(),
55 SSLConfig(), destination, origin_url, alternative_service, nullptr);
56
57 EXPECT_CALL(*alternative_job_, Start(_)).Times(1);
58
59 return alternative_job_;
60 }
61
62 TestHttpStreamFactoryImplJob::TestHttpStreamFactoryImplJob(
63 HttpStreamFactoryImpl::Job::Delegate* delegate,
64 HttpStreamFactoryImpl::JobType job_type,
65 HttpNetworkSession* session,
66 const HttpRequestInfo& request_info,
67 RequestPriority priority,
68 const SSLConfig& server_ssl_config,
69 const SSLConfig& proxy_ssl_config,
70 HostPortPair destination,
71 GURL origin_url,
72 NetLog* net_log)
73 : HttpStreamFactoryImpl::Job(delegate,
74 job_type,
75 session,
76 request_info,
77 priority,
78 server_ssl_config,
79 proxy_ssl_config,
80 destination,
81 origin_url,
82 net_log) {}
83
84 TestHttpStreamFactoryImplJob::TestHttpStreamFactoryImplJob(
85 HttpStreamFactoryImpl::Job::Delegate* delegate,
86 HttpStreamFactoryImpl::JobType job_type,
87 HttpNetworkSession* session,
88 const HttpRequestInfo& request_info,
89 RequestPriority priority,
90 const SSLConfig& server_ssl_config,
91 const SSLConfig& proxy_ssl_config,
92 HostPortPair destination,
93 GURL origin_url,
94 AlternativeService alternative_service,
95 NetLog* net_log)
96 : HttpStreamFactoryImpl::Job(delegate,
97 job_type,
98 session,
99 request_info,
100 priority,
101 server_ssl_config,
102 proxy_ssl_config,
103 destination,
104 origin_url,
105 alternative_service,
106 net_log) {}
107
108 TestHttpStreamFactoryImplJob::~TestHttpStreamFactoryImplJob() {}
109
110 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698