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

Unified Diff: net/spdy/spdy_session_unittest.cc

Issue 7484051: Merging SPDY IP connection pooling changes from the trunk (r93105) (Closed) Base URL: svn://svn.chromium.org/chrome/branches/782/src/
Patch Set: '' Created 9 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/spdy/spdy_session_pool.cc ('k') | net/spdy/spdy_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_unittest.cc
===================================================================
--- net/spdy/spdy_session_unittest.cc (revision 93497)
+++ net/spdy/spdy_session_unittest.cc (working copy)
@@ -4,6 +4,7 @@
#include "net/spdy/spdy_session.h"
+#include "net/base/ip_endpoint.h"
#include "net/spdy/spdy_io_buffer.h"
#include "net/spdy/spdy_session_pool.h"
#include "net/spdy/spdy_stream.h"
@@ -416,9 +417,10 @@
std::string name;
std::string iplist;
HostPortProxyPair pair;
+ AddressList addresses;
} test_hosts[] = {
- { "www.foo.com", "192.168.0.1,192.168.0.5" },
- { "images.foo.com", "192.168.0.2,192.168.0.3,192.168.0.5" },
+ { "www.foo.com", "192.0.2.33,192.168.0.1,192.168.0.5" },
+ { "images.foo.com", "192.168.0.2,192.168.0.3,192.168.0.5,192.0.2.33" },
{ "js.foo.com", "192.168.0.4,192.168.0.3" },
};
@@ -431,9 +433,8 @@
// This test requires that the HostResolver cache be populated. Normal
// code would have done this already, but we do it manually.
HostResolver::RequestInfo info(HostPortPair(test_hosts[i].name, kTestPort));
- AddressList result;
session_deps.host_resolver->Resolve(
- info, &result, NULL, NULL, BoundNetLog());
+ info, &test_hosts[i].addresses, NULL, NULL, BoundNetLog());
// Setup a HostPortProxyPair
test_hosts[i].pair = HostPortProxyPair(
@@ -477,6 +478,12 @@
BoundNetLog()));
EXPECT_EQ(OK, session->InitializeWithSocket(connection.release(), false, OK));
+ // TODO(rtenneti): MockClientSocket::GetPeerAddress return's 0 as the port
+ // number. Fix it to return port 80 and then use GetPeerAddress to AddAlias.
+ const addrinfo* address = test_hosts[0].addresses.head();
+ SpdySessionPoolPeer pool_peer(spdy_session_pool);
+ pool_peer.AddAlias(address, test_hosts[0].pair);
+
// Flush the SpdySession::OnReadComplete() task.
MessageLoop::current()->RunAllPending();
« no previous file with comments | « net/spdy/spdy_session_pool.cc ('k') | net/spdy/spdy_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698