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

Side by Side Diff: net/url_request/url_request_ftp_job_unittest.cc

Issue 1888963004: Add HttpProtocolHandler and convert everything to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-supports-scheme
Patch Set: rebase (needs fixing) Created 4 years, 2 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
« no previous file with comments | « net/url_request/url_request_context_builder.cc ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "net/url_request/url_request_ftp_job.h" 5 #include "net/url_request/url_request_ftp_job.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 FtpTestURLRequestContext(ClientSocketFactory* socket_factory, 71 FtpTestURLRequestContext(ClientSocketFactory* socket_factory,
72 std::unique_ptr<ProxyService> proxy_service, 72 std::unique_ptr<ProxyService> proxy_service,
73 NetworkDelegate* network_delegate, 73 NetworkDelegate* network_delegate,
74 FtpTransactionFactory* ftp_transaction_factory) 74 FtpTransactionFactory* ftp_transaction_factory)
75 : TestURLRequestContext(true), 75 : TestURLRequestContext(true),
76 ftp_protocol_handler_(new FtpProtocolHandler(ftp_transaction_factory)) { 76 ftp_protocol_handler_(new FtpProtocolHandler(ftp_transaction_factory)) {
77 set_client_socket_factory(socket_factory); 77 set_client_socket_factory(socket_factory);
78 context_storage_.set_proxy_service(std::move(proxy_service)); 78 context_storage_.set_proxy_service(std::move(proxy_service));
79 set_network_delegate(network_delegate); 79 set_network_delegate(network_delegate);
80 std::unique_ptr<URLRequestJobFactoryImpl> job_factory = 80 std::unique_ptr<URLRequestJobFactoryImpl> job_factory =
81 base::WrapUnique(new URLRequestJobFactoryImpl); 81 URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers();
82
82 job_factory->SetProtocolHandler("ftp", 83 job_factory->SetProtocolHandler("ftp",
83 base::WrapUnique(ftp_protocol_handler_)); 84 base::WrapUnique(ftp_protocol_handler_));
84 context_storage_.set_job_factory(std::move(job_factory)); 85 context_storage_.set_job_factory(std::move(job_factory));
85 Init(); 86 Init();
86 } 87 }
87 88
88 FtpAuthCache* GetFtpAuthCache() { 89 FtpAuthCache* GetFtpAuthCache() {
89 return ftp_protocol_handler_->ftp_auth_cache_.get(); 90 return ftp_protocol_handler_->ftp_auth_cache_.get();
90 } 91 }
91 92
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 EXPECT_TRUE(url_request2->status().is_success()); 802 EXPECT_TRUE(url_request2->status().is_success());
802 EXPECT_EQ(2, network_delegate()->completed_requests()); 803 EXPECT_EQ(2, network_delegate()->completed_requests());
803 EXPECT_EQ(0, network_delegate()->error_count()); 804 EXPECT_EQ(0, network_delegate()->error_count());
804 EXPECT_FALSE(request_delegate2.auth_required_called()); 805 EXPECT_FALSE(request_delegate2.auth_required_called());
805 EXPECT_EQ("test2.html", request_delegate2.data_received()); 806 EXPECT_EQ("test2.html", request_delegate2.data_received());
806 } 807 }
807 808
808 } // namespace 809 } // namespace
809 810
810 } // namespace net 811 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context_builder.cc ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698