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

Unified 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 and rewrite test cases Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/http/http_stream_factory_test_util.cc
diff --git a/net/http/http_stream_factory_test_util.cc b/net/http/http_stream_factory_test_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0dc3985b944bb708786f65fd5e523d4e66897a04
--- /dev/null
+++ b/net/http/http_stream_factory_test_util.cc
@@ -0,0 +1,96 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/http/http_stream_factory_test_util.h"
+
+#include "net/proxy/proxy_info.h"
+
+namespace net {
+TestHttpStreamRequestDelegate::TestHttpStreamRequestDelegate() {}
+
+TestHttpStreamRequestDelegate::~TestHttpStreamRequestDelegate() {}
+
+TestJobFactory::TestJobFactory()
+ : main_job_(nullptr), alternative_job_(nullptr) {}
+
+TestJobFactory::~TestJobFactory() {}
+
+HttpStreamFactoryImpl::Job* TestJobFactory::CreateJob(
+ HttpStreamFactoryImpl::Job::Delegate* delegate,
+ HttpStreamFactoryImpl::JobType job_type,
+ HttpNetworkSession* session,
+ const HttpRequestInfo& request_info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config,
+ HostPortPair destination,
+ GURL origin_url,
+ NetLog* net_log) {
+ return main_job_.release();
+}
+
+HttpStreamFactoryImpl::Job* TestJobFactory::CreateJob(
+ HttpStreamFactoryImpl::Job::Delegate* delegate,
+ HttpStreamFactoryImpl::JobType job_type,
+ HttpNetworkSession* session,
+ const HttpRequestInfo& request_info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config,
+ HostPortPair destination,
+ GURL origin_url,
+ AlternativeService alternative_service,
+ NetLog* net_log) {
+ return alternative_job_.release();
+}
+
+TestHttpStreamFactoryImplJob::TestHttpStreamFactoryImplJob(
+ HttpStreamFactoryImpl::Job::Delegate* delegate,
+ HttpStreamFactoryImpl::JobType job_type,
+ HttpNetworkSession* session,
+ const HttpRequestInfo& request_info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config,
+ HostPortPair destination,
+ GURL origin_url,
+ NetLog* net_log)
+ : HttpStreamFactoryImpl::Job(delegate,
+ job_type,
+ session,
+ request_info,
+ priority,
+ server_ssl_config,
+ proxy_ssl_config,
+ destination,
+ origin_url,
+ net_log) {}
+
+TestHttpStreamFactoryImplJob::TestHttpStreamFactoryImplJob(
+ HttpStreamFactoryImpl::Job::Delegate* delegate,
+ HttpStreamFactoryImpl::JobType job_type,
+ HttpNetworkSession* session,
+ const HttpRequestInfo& request_info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config,
+ HostPortPair destination,
+ GURL origin_url,
+ AlternativeService alternative_service,
+ NetLog* net_log)
+ : HttpStreamFactoryImpl::Job(delegate,
+ job_type,
+ session,
+ request_info,
+ priority,
+ server_ssl_config,
+ proxy_ssl_config,
+ destination,
+ origin_url,
+ alternative_service,
+ net_log) {}
+
+TestHttpStreamFactoryImplJob::~TestHttpStreamFactoryImplJob() {}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698