| 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 66c71c3a12fcd8eebf665ae2f6769301625723d6..e9fe0f2d617ff4f9be22d21f323dc6305f567238 100644
|
| --- a/net/spdy/spdy_session_pool_unittest.cc
|
| +++ b/net/spdy/spdy_session_pool_unittest.cc
|
| @@ -111,8 +111,8 @@ TEST_F(SpdySessionPoolTest, CloseCurrentSessions) {
|
| CreateNetworkSession();
|
|
|
| // Setup the first session to the first host.
|
| - base::WeakPtr<SpdySession> session =
|
| - CreateInsecureSpdySession(http_session_.get(), test_key, BoundNetLog());
|
| + base::WeakPtr<SpdySession> session = CreateInsecureSpdySession(
|
| + http_session_.get(), test_key, NetLogWithSource());
|
|
|
| // Flush the SpdySession::OnReadComplete() task.
|
| base::RunLoop().RunUntilIdle();
|
| @@ -121,10 +121,9 @@ TEST_F(SpdySessionPoolTest, CloseCurrentSessions) {
|
| EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_key));
|
|
|
| // Set the stream to create a new session when it is closed.
|
| - base::WeakPtr<SpdyStream> spdy_stream =
|
| - CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
|
| - session, GURL("http://www.foo.com"),
|
| - MEDIUM, BoundNetLog());
|
| + base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(
|
| + SPDY_BIDIRECTIONAL_STREAM, session, GURL("http://www.foo.com"), MEDIUM,
|
| + NetLogWithSource());
|
| SessionOpeningDelegate delegate(spdy_session_pool_, test_key);
|
| spdy_stream->SetDelegate(&delegate);
|
|
|
| @@ -157,11 +156,10 @@ TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) {
|
| SpdySessionKey key1(test_host_port_pair1, ProxyServer::Direct(),
|
| PRIVACY_MODE_DISABLED);
|
| base::WeakPtr<SpdySession> session1 =
|
| - CreateInsecureSpdySession(http_session_.get(), key1, BoundNetLog());
|
| + CreateInsecureSpdySession(http_session_.get(), key1, NetLogWithSource());
|
| GURL url1(kTestHost1);
|
| - base::WeakPtr<SpdyStream> spdy_stream1 =
|
| - CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
|
| - session1, url1, MEDIUM, BoundNetLog());
|
| + base::WeakPtr<SpdyStream> spdy_stream1 = CreateStreamSynchronously(
|
| + SPDY_BIDIRECTIONAL_STREAM, session1, url1, MEDIUM, NetLogWithSource());
|
| ASSERT_TRUE(spdy_stream1);
|
|
|
| // Set up session 2
|
| @@ -173,11 +171,10 @@ TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) {
|
| SpdySessionKey key2(test_host_port_pair2, ProxyServer::Direct(),
|
| PRIVACY_MODE_DISABLED);
|
| base::WeakPtr<SpdySession> session2 =
|
| - CreateInsecureSpdySession(http_session_.get(), key2, BoundNetLog());
|
| + CreateInsecureSpdySession(http_session_.get(), key2, NetLogWithSource());
|
| GURL url2(kTestHost2);
|
| - base::WeakPtr<SpdyStream> spdy_stream2 =
|
| - CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
|
| - session2, url2, MEDIUM, BoundNetLog());
|
| + base::WeakPtr<SpdyStream> spdy_stream2 = CreateStreamSynchronously(
|
| + SPDY_BIDIRECTIONAL_STREAM, session2, url2, MEDIUM, NetLogWithSource());
|
| ASSERT_TRUE(spdy_stream2);
|
|
|
| // Set up session 3
|
| @@ -189,11 +186,10 @@ TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) {
|
| SpdySessionKey key3(test_host_port_pair3, ProxyServer::Direct(),
|
| PRIVACY_MODE_DISABLED);
|
| base::WeakPtr<SpdySession> session3 =
|
| - CreateInsecureSpdySession(http_session_.get(), key3, BoundNetLog());
|
| + CreateInsecureSpdySession(http_session_.get(), key3, NetLogWithSource());
|
| GURL url3(kTestHost3);
|
| - base::WeakPtr<SpdyStream> spdy_stream3 =
|
| - CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
|
| - session3, url3, MEDIUM, BoundNetLog());
|
| + base::WeakPtr<SpdyStream> spdy_stream3 = CreateStreamSynchronously(
|
| + SPDY_BIDIRECTIONAL_STREAM, session3, url3, MEDIUM, NetLogWithSource());
|
| ASSERT_TRUE(spdy_stream3);
|
|
|
| // All sessions are active and not closed
|
| @@ -286,8 +282,8 @@ TEST_F(SpdySessionPoolTest, CloseAllSessions) {
|
| CreateNetworkSession();
|
|
|
| // Setup the first session to the first host.
|
| - base::WeakPtr<SpdySession> session =
|
| - CreateInsecureSpdySession(http_session_.get(), test_key, BoundNetLog());
|
| + base::WeakPtr<SpdySession> session = CreateInsecureSpdySession(
|
| + http_session_.get(), test_key, NetLogWithSource());
|
|
|
| // Flush the SpdySession::OnReadComplete() task.
|
| base::RunLoop().RunUntilIdle();
|
| @@ -296,10 +292,9 @@ TEST_F(SpdySessionPoolTest, CloseAllSessions) {
|
| EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_key));
|
|
|
| // Set the stream to create a new session when it is closed.
|
| - base::WeakPtr<SpdyStream> spdy_stream =
|
| - CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
|
| - session, GURL("http://www.foo.com"),
|
| - MEDIUM, BoundNetLog());
|
| + base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(
|
| + SPDY_BIDIRECTIONAL_STREAM, session, GURL("http://www.foo.com"), MEDIUM,
|
| + NetLogWithSource());
|
| SessionOpeningDelegate delegate(spdy_session_pool_, test_key);
|
| spdy_stream->SetDelegate(&delegate);
|
|
|
| @@ -351,7 +346,7 @@ void SpdySessionPoolTest::RunIPPoolingTest(
|
| HostResolver::RequestInfo info(HostPortPair(test_hosts[i].name, kTestPort));
|
| session_deps_.host_resolver->Resolve(
|
| info, DEFAULT_PRIORITY, &test_hosts[i].addresses, CompletionCallback(),
|
| - &request[i], BoundNetLog());
|
| + &request[i], NetLogWithSource());
|
|
|
| // Setup a SpdySessionKey
|
| test_hosts[i].key = SpdySessionKey(
|
| @@ -375,7 +370,7 @@ void SpdySessionPoolTest::RunIPPoolingTest(
|
|
|
| // Setup the first session to the first host.
|
| base::WeakPtr<SpdySession> session = CreateInsecureSpdySession(
|
| - http_session_.get(), test_hosts[0].key, BoundNetLog());
|
| + http_session_.get(), test_hosts[0].key, NetLogWithSource());
|
|
|
| // Flush the SpdySession::OnReadComplete() task.
|
| base::RunLoop().RunUntilIdle();
|
| @@ -400,7 +395,7 @@ void SpdySessionPoolTest::RunIPPoolingTest(
|
| data2.set_connect_data(connect_data);
|
| session_deps_.socket_factory->AddSocketDataProvider(&data2);
|
| base::WeakPtr<SpdySession> session2 = CreateInsecureSpdySession(
|
| - http_session_.get(), test_hosts[2].key, BoundNetLog());
|
| + http_session_.get(), test_hosts[2].key, NetLogWithSource());
|
|
|
| // Verify that we have sessions for everything.
|
| EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[0].key));
|
| @@ -411,7 +406,7 @@ void SpdySessionPoolTest::RunIPPoolingTest(
|
| // 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), BoundNetLog());
|
| + test_hosts[1].key, GURL(test_hosts[1].url), NetLogWithSource());
|
| EXPECT_EQ(session.get(), session1.get());
|
| EXPECT_NE(session2.get(), session1.get());
|
|
|
| @@ -439,17 +434,16 @@ void SpdySessionPoolTest::RunIPPoolingTest(
|
| break;
|
| case SPDY_POOL_CLOSE_IDLE_SESSIONS:
|
| GURL url(test_hosts[0].url);
|
| - base::WeakPtr<SpdyStream> spdy_stream =
|
| - CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
|
| - session, url, MEDIUM, BoundNetLog());
|
| + base::WeakPtr<SpdyStream> spdy_stream = CreateStreamSynchronously(
|
| + SPDY_BIDIRECTIONAL_STREAM, session, url, MEDIUM, NetLogWithSource());
|
| GURL url1(test_hosts[1].url);
|
| base::WeakPtr<SpdyStream> spdy_stream1 =
|
| - CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
|
| - session1, url1, MEDIUM, BoundNetLog());
|
| + CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session1, url1,
|
| + MEDIUM, NetLogWithSource());
|
| GURL url2(test_hosts[2].url);
|
| base::WeakPtr<SpdyStream> spdy_stream2 =
|
| - CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
|
| - session2, url2, MEDIUM, BoundNetLog());
|
| + CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, session2, url2,
|
| + MEDIUM, NetLogWithSource());
|
|
|
| // Close streams to make spdy_session and spdy_session1 inactive.
|
| session->CloseCreatedStream(spdy_stream, OK);
|
| @@ -541,11 +535,11 @@ TEST_F(SpdySessionPoolTest, IPAddressChanged) {
|
| SpdySessionKey keyA(
|
| test_host_port_pairA, ProxyServer::Direct(), PRIVACY_MODE_DISABLED);
|
| base::WeakPtr<SpdySession> sessionA =
|
| - CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog());
|
| + CreateInsecureSpdySession(http_session_.get(), keyA, NetLogWithSource());
|
|
|
| GURL urlA(kTestHostA);
|
| base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously(
|
| - SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog());
|
| + SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, NetLogWithSource());
|
| test::StreamDelegateDoNothing delegateA(spdy_streamA);
|
| spdy_streamA->SetDelegate(&delegateA);
|
|
|
| @@ -569,12 +563,12 @@ TEST_F(SpdySessionPoolTest, IPAddressChanged) {
|
| SpdySessionKey keyB(
|
| test_host_port_pairB, ProxyServer::Direct(), PRIVACY_MODE_DISABLED);
|
| base::WeakPtr<SpdySession> sessionB =
|
| - CreateInsecureSpdySession(http_session_.get(), keyB, BoundNetLog());
|
| + CreateInsecureSpdySession(http_session_.get(), keyB, NetLogWithSource());
|
| EXPECT_TRUE(sessionB->IsAvailable());
|
|
|
| GURL urlB(kTestHostB);
|
| base::WeakPtr<SpdyStream> spdy_streamB = CreateStreamSynchronously(
|
| - SPDY_BIDIRECTIONAL_STREAM, sessionB, urlB, MEDIUM, BoundNetLog());
|
| + SPDY_BIDIRECTIONAL_STREAM, sessionB, urlB, MEDIUM, NetLogWithSource());
|
| test::StreamDelegateDoNothing delegateB(spdy_streamB);
|
| spdy_streamB->SetDelegate(&delegateB);
|
|
|
| @@ -588,7 +582,7 @@ TEST_F(SpdySessionPoolTest, IPAddressChanged) {
|
| SpdySessionKey keyC(
|
| test_host_port_pairC, ProxyServer::Direct(), PRIVACY_MODE_DISABLED);
|
| base::WeakPtr<SpdySession> sessionC =
|
| - CreateInsecureSpdySession(http_session_.get(), keyC, BoundNetLog());
|
| + CreateInsecureSpdySession(http_session_.get(), keyC, NetLogWithSource());
|
|
|
| sessionC->CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Error!");
|
| EXPECT_TRUE(sessionC->IsDraining());
|
| @@ -640,7 +634,7 @@ TEST_F(SpdySessionPoolTest, FindAvailableSession) {
|
| CreateNetworkSession();
|
|
|
| base::WeakPtr<SpdySession> session =
|
| - CreateInsecureSpdySession(http_session_.get(), key, BoundNetLog());
|
| + CreateInsecureSpdySession(http_session_.get(), key, NetLogWithSource());
|
|
|
| // Flush the SpdySession::OnReadComplete() task.
|
| base::RunLoop().RunUntilIdle();
|
| @@ -649,14 +643,14 @@ TEST_F(SpdySessionPoolTest, FindAvailableSession) {
|
|
|
| // FindAvailableSession should return |session| if called with empty |url|.
|
| base::WeakPtr<SpdySession> session1 =
|
| - spdy_session_pool_->FindAvailableSession(key, GURL(), BoundNetLog());
|
| + spdy_session_pool_->FindAvailableSession(key, GURL(), NetLogWithSource());
|
| EXPECT_EQ(session.get(), session1.get());
|
|
|
| // FindAvailableSession should return |session| if called with |url| for which
|
| // there is no pushed stream on any sessions owned by |spdy_session_pool_|.
|
| base::WeakPtr<SpdySession> session2 =
|
| spdy_session_pool_->FindAvailableSession(
|
| - key, GURL("http://news.example.org/foo.html"), BoundNetLog());
|
| + key, GURL("http://news.example.org/foo.html"), NetLogWithSource());
|
| EXPECT_EQ(session.get(), session2.get());
|
|
|
| spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED);
|
|
|