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

Unified Diff: net/spdy/spdy_session_pool_unittest.cc

Issue 2771263002: Retry upon 421 status code without IP pooling. (Closed)
Patch Set: Rebase. 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 dbdade06cfe3eaf28ffd2e1f56bbb1abc8feaf12..58596dbdf8b450656e43377b94cef8305dbde3fe 100644
--- a/net/spdy/spdy_session_pool_unittest.cc
+++ b/net/spdy/spdy_session_pool_unittest.cc
@@ -393,6 +393,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/"),
@@ -419,10 +427,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());
« net/http/http_network_transaction.cc ('K') | « net/http/http_stream_factory_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698