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

Unified Diff: net/spdy/spdy_session_pool_unittest.cc

Issue 2771263002: Retry upon 421 status code without IP pooling. (Closed)
Patch Set: Created 3 years, 9 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
Index: net/spdy/spdy_session_pool_unittest.cc
diff --git a/net/spdy/spdy_session_pool_unittest.cc b/net/spdy/spdy_session_pool_unittest.cc
index 2d0d845e9f9a8179ed20ddd85f6d152a31320bfb..4703dbf95259a4ac90ce17f43ae5aad9ca3e1da7 100644
--- a/net/spdy/spdy_session_pool_unittest.cc
+++ b/net/spdy/spdy_session_pool_unittest.cc
@@ -391,6 +391,14 @@ void SpdySessionPoolTest::RunIPPoolingTest(
// The second host overlaps with the first, and should IP pool.
EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[1].key));
+ // However, if IP pooling is disabled, FindAvailableSession() should not find
+ // |session| for the second host.
+ base::WeakPtr<SpdySession> session1 =
+ spdy_session_pool_->FindAvailableSession(
+ test_hosts[1].key, GURL(test_hosts[1].url),
+ /* enable_ip_based_pooling = */ false, NetLogWithSource());
+ EXPECT_FALSE(session1);
+
// Verify that the second host, through a proxy, won't share the IP.
SpdySessionKey proxy_key(test_hosts[1].key.host_port_pair(),
ProxyServer::FromPacString("HTTP http://proxy.foo.com/"),
@@ -417,10 +425,9 @@ void SpdySessionPoolTest::RunIPPoolingTest(
// Grab the session to host 1 and verify that it is the same session
// we got with host 0, and that is a different from host 2's session.
- base::WeakPtr<SpdySession> session1 =
- spdy_session_pool_->FindAvailableSession(
- test_hosts[1].key, GURL(test_hosts[1].url),
- /* enable_ip_based_pooling = */ true, NetLogWithSource());
+ session1 = spdy_session_pool_->FindAvailableSession(
+ test_hosts[1].key, GURL(test_hosts[1].url),
+ /* enable_ip_based_pooling = */ true, NetLogWithSource());
EXPECT_EQ(session.get(), session1.get());
EXPECT_NE(session2.get(), session1.get());

Powered by Google App Engine
This is Rietveld 408576698