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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 2428143002: Clean up FtpTransactionFacory ownership. (Closed)
Patch Set: --typos 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_ftp_job_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 5b98e35153751db431f745e670ecf9a6665be286..e87119195ede9de1568ce4ed182a65ef6943cc07 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -9858,8 +9858,7 @@ TEST_F(HTTPSCRLSetTest, CRLSetRevoked) {
class URLRequestTestFTP : public URLRequestTest {
public:
URLRequestTestFTP()
- : ftp_transaction_factory_(&host_resolver_),
- ftp_test_server_(SpawnedTestServer::TYPE_FTP,
+ : ftp_test_server_(SpawnedTestServer::TYPE_FTP,
SpawnedTestServer::kLocalhost,
base::FilePath(kTestFilePath)) {
// Can't use |default_context_|'s HostResolver to set up the
@@ -9871,7 +9870,7 @@ class URLRequestTestFTP : public URLRequestTest {
void SetUpFactory() override {
// Add FTP support to the default URLRequestContext.
job_factory_impl_->SetProtocolHandler(
- "ftp", base::MakeUnique<FtpProtocolHandler>(&ftp_transaction_factory_));
+ "ftp", FtpProtocolHandler::Create(&host_resolver_));
}
std::string GetTestFileContents() {
@@ -9885,8 +9884,10 @@ class URLRequestTestFTP : public URLRequestTest {
}
protected:
+ // Note that this is destroyed before the FtpProtocolHandler that references
+ // it, which is owned by the parent class. Since no requests are made during
+ // teardown, this works, though it's not great.
MockHostResolver host_resolver_;
- FtpNetworkLayer ftp_transaction_factory_;
SpawnedTestServer ftp_test_server_;
};
« no previous file with comments | « net/url_request/url_request_ftp_job_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698