diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-14 06:35:54 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-14 06:35:54 +0000 |
commit | 6cbfa853c0ae1eded9d08972edd98ed72b25442f (patch) | |
tree | 993b90b5b91db5a3a3b8f2babb4c5a0416c9e6bc /net/spdy/spdy_session_spdy2_unittest.cc | |
parent | 004432da901260a8b2a4993b6de8bab4f9b825b4 (diff) | |
download | chromium_src-6cbfa853c0ae1eded9d08972edd98ed72b25442f.zip chromium_src-6cbfa853c0ae1eded9d08972edd98ed72b25442f.tar.gz chromium_src-6cbfa853c0ae1eded9d08972edd98ed72b25442f.tar.bz2 |
Change SpdySessionPool to explicitly associate IP pooled sessions with the matching hostnames.
BUG=106225
TEST=SpdySessionSpdy\*Test.IPPooling\*
Review URL: http://codereview.chromium.org/9621011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126594 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session_spdy2_unittest.cc')
-rw-r--r-- | net/spdy/spdy_session_spdy2_unittest.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/spdy/spdy_session_spdy2_unittest.cc b/net/spdy/spdy_session_spdy2_unittest.cc index a5f8af7..5d85f8f 100644 --- a/net/spdy/spdy_session_spdy2_unittest.cc +++ b/net/spdy/spdy_session_spdy2_unittest.cc @@ -4,6 +4,7 @@ #include "net/spdy/spdy_session.h" +#include "net/base/host_cache.h" #include "net/base/ip_endpoint.h" #include "net/base/net_log_unittest.h" #include "net/spdy/spdy_io_buffer.h" @@ -841,6 +842,22 @@ void IPPoolingTest(bool clean_via_close_current_sessions) { EXPECT_TRUE(spdy_session_pool->HasSession(test_hosts[1].pair)); EXPECT_TRUE(spdy_session_pool->HasSession(test_hosts[2].pair)); + // Grab the session to host 1 and verify that it is the same session + // we got with host 0, and that is a different than host 2's session. + scoped_refptr<SpdySession> session1 = + spdy_session_pool->Get(test_hosts[1].pair, BoundNetLog()); + EXPECT_EQ(session.get(), session1.get()); + EXPECT_NE(session2.get(), session1.get()); + + // Remove the aliases and observe that we still have a session for host1. + pool_peer.RemoveAliases(test_hosts[0].pair); + pool_peer.RemoveAliases(test_hosts[1].pair); + EXPECT_TRUE(spdy_session_pool->HasSession(test_hosts[1].pair)); + + // Expire the host cache + session_deps.host_resolver->GetHostCache()->clear(); + EXPECT_TRUE(spdy_session_pool->HasSession(test_hosts[1].pair)); + // Cleanup the sessions. if (!clean_via_close_current_sessions) { spdy_session_pool->Remove(session); |