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

Unified Diff: net/ftp/ftp_network_transaction_unittest.cc

Issue 149511: Refactorings surrounding HostResolver:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Merge in socks5_client_socket_unittest.cc Created 11 years, 5 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/base/run_all_unittests.cc ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_network_transaction_unittest.cc
===================================================================
--- net/ftp/ftp_network_transaction_unittest.cc (revision 20760)
+++ net/ftp/ftp_network_transaction_unittest.cc (working copy)
@@ -5,9 +5,8 @@
#include "net/ftp/ftp_network_transaction.h"
#include "base/ref_counted.h"
-#include "net/base/host_resolver.h"
-#include "net/base/host_resolver_unittest.h"
#include "net/base/io_buffer.h"
+#include "net/base/mock_host_resolver.h"
#include "net/base/test_completion_callback.h"
#include "net/ftp/ftp_network_session.h"
#include "net/ftp/ftp_request_info.h"
@@ -237,7 +236,8 @@
class FtpNetworkTransactionTest : public PlatformTest {
public:
FtpNetworkTransactionTest()
- : session_(new FtpNetworkSession(new HostResolver)),
+ : host_resolver_(new MockHostResolver),
+ session_(new FtpNetworkSession(host_resolver_)),
transaction_(session_.get(), &mock_socket_factory_) {
}
@@ -286,6 +286,7 @@
ExecuteTransaction(ctrl_socket, request, expected_result);
}
+ scoped_refptr<MockHostResolver> host_resolver_;
scoped_refptr<FtpNetworkSession> session_;
MockClientSocketFactory mock_socket_factory_;
FtpNetworkTransaction transaction_;
@@ -294,9 +295,7 @@
TEST_F(FtpNetworkTransactionTest, FailedLookup) {
FtpRequestInfo request_info = GetRequestInfo("ftp://badhost");
- scoped_refptr<RuleBasedHostMapper> mapper(new RuleBasedHostMapper());
- mapper->AddSimulatedFailure("badhost");
- ScopedHostMapper scoped_mapper(mapper.get());
+ host_resolver_->rules()->AddSimulatedFailure("badhost");
ASSERT_EQ(ERR_IO_PENDING, transaction_.Start(&request_info, &callback_));
EXPECT_EQ(ERR_FAILED, callback_.WaitForResult());
}
« no previous file with comments | « net/base/run_all_unittests.cc ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698