OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/spdy/spdy_session_pool.h" | 5 #include "net/spdy/spdy_session_pool.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 spdy_session_pool_(NULL) {} | 37 spdy_session_pool_(NULL) {} |
38 | 38 |
39 void CreateNetworkSession() { | 39 void CreateNetworkSession() { |
40 http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); | 40 http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); |
41 spdy_session_pool_ = http_session_->spdy_session_pool(); | 41 spdy_session_pool_ = http_session_->spdy_session_pool(); |
42 } | 42 } |
43 | 43 |
44 void RunIPPoolingTest(SpdyPoolCloseSessionsType close_sessions_type); | 44 void RunIPPoolingTest(SpdyPoolCloseSessionsType close_sessions_type); |
45 | 45 |
46 SpdySessionDependencies session_deps_; | 46 SpdySessionDependencies session_deps_; |
47 scoped_refptr<HttpNetworkSession> http_session_; | 47 scoped_ptr<HttpNetworkSession> http_session_; |
48 SpdySessionPool* spdy_session_pool_; | 48 SpdySessionPool* spdy_session_pool_; |
49 }; | 49 }; |
50 | 50 |
51 INSTANTIATE_TEST_CASE_P(NextProto, | 51 INSTANTIATE_TEST_CASE_P(NextProto, |
52 SpdySessionPoolTest, | 52 SpdySessionPoolTest, |
53 testing::Values(kProtoSPDY31, | 53 testing::Values(kProtoSPDY31, |
54 kProtoHTTP2)); | 54 kProtoHTTP2)); |
55 | 55 |
56 // A delegate that opens a new session when it is closed. | 56 // A delegate that opens a new session when it is closed. |
57 class SessionOpeningDelegate : public SpdyStream::Delegate { | 57 class SessionOpeningDelegate : public SpdyStream::Delegate { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 data.set_connect_data(connect_data); | 108 data.set_connect_data(connect_data); |
109 session_deps_.socket_factory->AddSocketDataProvider(&data); | 109 session_deps_.socket_factory->AddSocketDataProvider(&data); |
110 | 110 |
111 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); | 111 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); |
112 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); | 112 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); |
113 | 113 |
114 CreateNetworkSession(); | 114 CreateNetworkSession(); |
115 | 115 |
116 // Setup the first session to the first host. | 116 // Setup the first session to the first host. |
117 base::WeakPtr<SpdySession> session = | 117 base::WeakPtr<SpdySession> session = |
118 CreateInsecureSpdySession(http_session_, test_key, BoundNetLog()); | 118 CreateInsecureSpdySession(http_session_.get(), test_key, BoundNetLog()); |
119 | 119 |
120 // Flush the SpdySession::OnReadComplete() task. | 120 // Flush the SpdySession::OnReadComplete() task. |
121 base::MessageLoop::current()->RunUntilIdle(); | 121 base::MessageLoop::current()->RunUntilIdle(); |
122 | 122 |
123 // Verify that we have sessions for everything. | 123 // Verify that we have sessions for everything. |
124 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_key)); | 124 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_key)); |
125 | 125 |
126 // Set the stream to create a new session when it is closed. | 126 // Set the stream to create a new session when it is closed. |
127 base::WeakPtr<SpdyStream> spdy_stream = | 127 base::WeakPtr<SpdyStream> spdy_stream = |
128 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, | 128 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, |
(...skipping 24 matching lines...) Expand all Loading... |
153 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); | 153 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); |
154 | 154 |
155 CreateNetworkSession(); | 155 CreateNetworkSession(); |
156 | 156 |
157 // Set up session 1 | 157 // Set up session 1 |
158 const std::string kTestHost1("http://www.a.com"); | 158 const std::string kTestHost1("http://www.a.com"); |
159 HostPortPair test_host_port_pair1(kTestHost1, 80); | 159 HostPortPair test_host_port_pair1(kTestHost1, 80); |
160 SpdySessionKey key1(test_host_port_pair1, ProxyServer::Direct(), | 160 SpdySessionKey key1(test_host_port_pair1, ProxyServer::Direct(), |
161 PRIVACY_MODE_DISABLED); | 161 PRIVACY_MODE_DISABLED); |
162 base::WeakPtr<SpdySession> session1 = | 162 base::WeakPtr<SpdySession> session1 = |
163 CreateInsecureSpdySession(http_session_, key1, BoundNetLog()); | 163 CreateInsecureSpdySession(http_session_.get(), key1, BoundNetLog()); |
164 GURL url1(kTestHost1); | 164 GURL url1(kTestHost1); |
165 base::WeakPtr<SpdyStream> spdy_stream1 = | 165 base::WeakPtr<SpdyStream> spdy_stream1 = |
166 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, | 166 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, |
167 session1, url1, MEDIUM, BoundNetLog()); | 167 session1, url1, MEDIUM, BoundNetLog()); |
168 ASSERT_TRUE(spdy_stream1.get() != NULL); | 168 ASSERT_TRUE(spdy_stream1.get() != NULL); |
169 | 169 |
170 // Set up session 2 | 170 // Set up session 2 |
171 session_deps_.socket_factory->AddSocketDataProvider(&data); | 171 session_deps_.socket_factory->AddSocketDataProvider(&data); |
172 const std::string kTestHost2("http://www.b.com"); | 172 const std::string kTestHost2("http://www.b.com"); |
173 HostPortPair test_host_port_pair2(kTestHost2, 80); | 173 HostPortPair test_host_port_pair2(kTestHost2, 80); |
174 SpdySessionKey key2(test_host_port_pair2, ProxyServer::Direct(), | 174 SpdySessionKey key2(test_host_port_pair2, ProxyServer::Direct(), |
175 PRIVACY_MODE_DISABLED); | 175 PRIVACY_MODE_DISABLED); |
176 base::WeakPtr<SpdySession> session2 = | 176 base::WeakPtr<SpdySession> session2 = |
177 CreateInsecureSpdySession(http_session_, key2, BoundNetLog()); | 177 CreateInsecureSpdySession(http_session_.get(), key2, BoundNetLog()); |
178 GURL url2(kTestHost2); | 178 GURL url2(kTestHost2); |
179 base::WeakPtr<SpdyStream> spdy_stream2 = | 179 base::WeakPtr<SpdyStream> spdy_stream2 = |
180 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, | 180 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, |
181 session2, url2, MEDIUM, BoundNetLog()); | 181 session2, url2, MEDIUM, BoundNetLog()); |
182 ASSERT_TRUE(spdy_stream2.get() != NULL); | 182 ASSERT_TRUE(spdy_stream2.get() != NULL); |
183 | 183 |
184 // Set up session 3 | 184 // Set up session 3 |
185 session_deps_.socket_factory->AddSocketDataProvider(&data); | 185 session_deps_.socket_factory->AddSocketDataProvider(&data); |
186 const std::string kTestHost3("http://www.c.com"); | 186 const std::string kTestHost3("http://www.c.com"); |
187 HostPortPair test_host_port_pair3(kTestHost3, 80); | 187 HostPortPair test_host_port_pair3(kTestHost3, 80); |
188 SpdySessionKey key3(test_host_port_pair3, ProxyServer::Direct(), | 188 SpdySessionKey key3(test_host_port_pair3, ProxyServer::Direct(), |
189 PRIVACY_MODE_DISABLED); | 189 PRIVACY_MODE_DISABLED); |
190 base::WeakPtr<SpdySession> session3 = | 190 base::WeakPtr<SpdySession> session3 = |
191 CreateInsecureSpdySession(http_session_, key3, BoundNetLog()); | 191 CreateInsecureSpdySession(http_session_.get(), key3, BoundNetLog()); |
192 GURL url3(kTestHost3); | 192 GURL url3(kTestHost3); |
193 base::WeakPtr<SpdyStream> spdy_stream3 = | 193 base::WeakPtr<SpdyStream> spdy_stream3 = |
194 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, | 194 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, |
195 session3, url3, MEDIUM, BoundNetLog()); | 195 session3, url3, MEDIUM, BoundNetLog()); |
196 ASSERT_TRUE(spdy_stream3.get() != NULL); | 196 ASSERT_TRUE(spdy_stream3.get() != NULL); |
197 | 197 |
198 // All sessions are active and not closed | 198 // All sessions are active and not closed |
199 EXPECT_TRUE(session1->is_active()); | 199 EXPECT_TRUE(session1->is_active()); |
200 EXPECT_TRUE(session1->IsAvailable()); | 200 EXPECT_TRUE(session1->IsAvailable()); |
201 EXPECT_TRUE(session2->is_active()); | 201 EXPECT_TRUE(session2->is_active()); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 data.set_connect_data(connect_data); | 279 data.set_connect_data(connect_data); |
280 session_deps_.socket_factory->AddSocketDataProvider(&data); | 280 session_deps_.socket_factory->AddSocketDataProvider(&data); |
281 | 281 |
282 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); | 282 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); |
283 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); | 283 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); |
284 | 284 |
285 CreateNetworkSession(); | 285 CreateNetworkSession(); |
286 | 286 |
287 // Setup the first session to the first host. | 287 // Setup the first session to the first host. |
288 base::WeakPtr<SpdySession> session = | 288 base::WeakPtr<SpdySession> session = |
289 CreateInsecureSpdySession(http_session_, test_key, BoundNetLog()); | 289 CreateInsecureSpdySession(http_session_.get(), test_key, BoundNetLog()); |
290 | 290 |
291 // Flush the SpdySession::OnReadComplete() task. | 291 // Flush the SpdySession::OnReadComplete() task. |
292 base::MessageLoop::current()->RunUntilIdle(); | 292 base::MessageLoop::current()->RunUntilIdle(); |
293 | 293 |
294 // Verify that we have sessions for everything. | 294 // Verify that we have sessions for everything. |
295 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_key)); | 295 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_key)); |
296 | 296 |
297 // Set the stream to create a new session when it is closed. | 297 // Set the stream to create a new session when it is closed. |
298 base::WeakPtr<SpdyStream> spdy_stream = | 298 base::WeakPtr<SpdyStream> spdy_stream = |
299 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, | 299 CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); | 368 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); |
369 data.set_connect_data(connect_data); | 369 data.set_connect_data(connect_data); |
370 session_deps_.socket_factory->AddSocketDataProvider(&data); | 370 session_deps_.socket_factory->AddSocketDataProvider(&data); |
371 | 371 |
372 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); | 372 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); |
373 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); | 373 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); |
374 | 374 |
375 CreateNetworkSession(); | 375 CreateNetworkSession(); |
376 | 376 |
377 // Setup the first session to the first host. | 377 // Setup the first session to the first host. |
378 base::WeakPtr<SpdySession> session = | 378 base::WeakPtr<SpdySession> session = CreateInsecureSpdySession( |
379 CreateInsecureSpdySession( | 379 http_session_.get(), test_hosts[0].key, BoundNetLog()); |
380 http_session_, test_hosts[0].key, BoundNetLog()); | |
381 | 380 |
382 // Flush the SpdySession::OnReadComplete() task. | 381 // Flush the SpdySession::OnReadComplete() task. |
383 base::MessageLoop::current()->RunUntilIdle(); | 382 base::MessageLoop::current()->RunUntilIdle(); |
384 | 383 |
385 // The third host has no overlap with the first, so it can't pool IPs. | 384 // The third host has no overlap with the first, so it can't pool IPs. |
386 EXPECT_FALSE(HasSpdySession(spdy_session_pool_, test_hosts[2].key)); | 385 EXPECT_FALSE(HasSpdySession(spdy_session_pool_, test_hosts[2].key)); |
387 | 386 |
388 // The second host overlaps with the first, and should IP pool. | 387 // The second host overlaps with the first, and should IP pool. |
389 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[1].key)); | 388 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[1].key)); |
390 | 389 |
391 // Verify that the second host, through a proxy, won't share the IP. | 390 // Verify that the second host, through a proxy, won't share the IP. |
392 SpdySessionKey proxy_key(test_hosts[1].key.host_port_pair(), | 391 SpdySessionKey proxy_key(test_hosts[1].key.host_port_pair(), |
393 ProxyServer::FromPacString("HTTP http://proxy.foo.com/"), | 392 ProxyServer::FromPacString("HTTP http://proxy.foo.com/"), |
394 PRIVACY_MODE_DISABLED); | 393 PRIVACY_MODE_DISABLED); |
395 EXPECT_FALSE(HasSpdySession(spdy_session_pool_, proxy_key)); | 394 EXPECT_FALSE(HasSpdySession(spdy_session_pool_, proxy_key)); |
396 | 395 |
397 // Overlap between 2 and 3 does is not transitive to 1. | 396 // Overlap between 2 and 3 does is not transitive to 1. |
398 EXPECT_FALSE(HasSpdySession(spdy_session_pool_, test_hosts[2].key)); | 397 EXPECT_FALSE(HasSpdySession(spdy_session_pool_, test_hosts[2].key)); |
399 | 398 |
400 // Create a new session to host 2. | 399 // Create a new session to host 2. |
401 session_deps_.socket_factory->AddSocketDataProvider(&data); | 400 session_deps_.socket_factory->AddSocketDataProvider(&data); |
402 base::WeakPtr<SpdySession> session2 = | 401 base::WeakPtr<SpdySession> session2 = CreateInsecureSpdySession( |
403 CreateInsecureSpdySession( | 402 http_session_.get(), test_hosts[2].key, BoundNetLog()); |
404 http_session_, test_hosts[2].key, BoundNetLog()); | |
405 | 403 |
406 // Verify that we have sessions for everything. | 404 // Verify that we have sessions for everything. |
407 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[0].key)); | 405 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[0].key)); |
408 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[1].key)); | 406 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[1].key)); |
409 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[2].key)); | 407 EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[2].key)); |
410 | 408 |
411 // Grab the session to host 1 and verify that it is the same session | 409 // Grab the session to host 1 and verify that it is the same session |
412 // we got with host 0, and that is a different from host 2's session. | 410 // we got with host 0, and that is a different from host 2's session. |
413 base::WeakPtr<SpdySession> session1 = | 411 base::WeakPtr<SpdySession> session1 = |
414 spdy_session_pool_->FindAvailableSession( | 412 spdy_session_pool_->FindAvailableSession( |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 | 529 |
532 CreateNetworkSession(); | 530 CreateNetworkSession(); |
533 | 531 |
534 // Set up session A: Going away, but with an active stream. | 532 // Set up session A: Going away, but with an active stream. |
535 session_deps_.socket_factory->AddSocketDataProvider(&data); | 533 session_deps_.socket_factory->AddSocketDataProvider(&data); |
536 const std::string kTestHostA("http://www.a.com"); | 534 const std::string kTestHostA("http://www.a.com"); |
537 HostPortPair test_host_port_pairA(kTestHostA, 80); | 535 HostPortPair test_host_port_pairA(kTestHostA, 80); |
538 SpdySessionKey keyA( | 536 SpdySessionKey keyA( |
539 test_host_port_pairA, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); | 537 test_host_port_pairA, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); |
540 base::WeakPtr<SpdySession> sessionA = | 538 base::WeakPtr<SpdySession> sessionA = |
541 CreateInsecureSpdySession(http_session_, keyA, BoundNetLog()); | 539 CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog()); |
542 | 540 |
543 GURL urlA(kTestHostA); | 541 GURL urlA(kTestHostA); |
544 base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously( | 542 base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously( |
545 SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog()); | 543 SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog()); |
546 test::StreamDelegateDoNothing delegateA(spdy_streamA); | 544 test::StreamDelegateDoNothing delegateA(spdy_streamA); |
547 spdy_streamA->SetDelegate(&delegateA); | 545 spdy_streamA->SetDelegate(&delegateA); |
548 | 546 |
549 scoped_ptr<SpdyHeaderBlock> headers( | 547 scoped_ptr<SpdyHeaderBlock> headers( |
550 spdy_util.ConstructGetHeaderBlock(urlA.spec())); | 548 spdy_util.ConstructGetHeaderBlock(urlA.spec())); |
551 spdy_streamA->SendRequestHeaders(headers.Pass(), NO_MORE_DATA_TO_SEND); | 549 spdy_streamA->SendRequestHeaders(headers.Pass(), NO_MORE_DATA_TO_SEND); |
552 EXPECT_TRUE(spdy_streamA->HasUrlFromHeaders()); | 550 EXPECT_TRUE(spdy_streamA->HasUrlFromHeaders()); |
553 | 551 |
554 base::MessageLoop::current()->RunUntilIdle(); // Allow headers to write. | 552 base::MessageLoop::current()->RunUntilIdle(); // Allow headers to write. |
555 EXPECT_TRUE(delegateA.send_headers_completed()); | 553 EXPECT_TRUE(delegateA.send_headers_completed()); |
556 | 554 |
557 sessionA->MakeUnavailable(); | 555 sessionA->MakeUnavailable(); |
558 EXPECT_TRUE(sessionA->IsGoingAway()); | 556 EXPECT_TRUE(sessionA->IsGoingAway()); |
559 EXPECT_FALSE(delegateA.StreamIsClosed()); | 557 EXPECT_FALSE(delegateA.StreamIsClosed()); |
560 | 558 |
561 // Set up session B: Available, with a created stream. | 559 // Set up session B: Available, with a created stream. |
562 const std::string kTestHostB("http://www.b.com"); | 560 const std::string kTestHostB("http://www.b.com"); |
563 HostPortPair test_host_port_pairB(kTestHostB, 80); | 561 HostPortPair test_host_port_pairB(kTestHostB, 80); |
564 SpdySessionKey keyB( | 562 SpdySessionKey keyB( |
565 test_host_port_pairB, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); | 563 test_host_port_pairB, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); |
566 base::WeakPtr<SpdySession> sessionB = | 564 base::WeakPtr<SpdySession> sessionB = |
567 CreateInsecureSpdySession(http_session_, keyB, BoundNetLog()); | 565 CreateInsecureSpdySession(http_session_.get(), keyB, BoundNetLog()); |
568 EXPECT_TRUE(sessionB->IsAvailable()); | 566 EXPECT_TRUE(sessionB->IsAvailable()); |
569 | 567 |
570 GURL urlB(kTestHostB); | 568 GURL urlB(kTestHostB); |
571 base::WeakPtr<SpdyStream> spdy_streamB = CreateStreamSynchronously( | 569 base::WeakPtr<SpdyStream> spdy_streamB = CreateStreamSynchronously( |
572 SPDY_BIDIRECTIONAL_STREAM, sessionB, urlB, MEDIUM, BoundNetLog()); | 570 SPDY_BIDIRECTIONAL_STREAM, sessionB, urlB, MEDIUM, BoundNetLog()); |
573 test::StreamDelegateDoNothing delegateB(spdy_streamB); | 571 test::StreamDelegateDoNothing delegateB(spdy_streamB); |
574 spdy_streamB->SetDelegate(&delegateB); | 572 spdy_streamB->SetDelegate(&delegateB); |
575 | 573 |
576 // Set up session C: Draining. | 574 // Set up session C: Draining. |
577 session_deps_.socket_factory->AddSocketDataProvider(&data); | 575 session_deps_.socket_factory->AddSocketDataProvider(&data); |
578 const std::string kTestHostC("http://www.c.com"); | 576 const std::string kTestHostC("http://www.c.com"); |
579 HostPortPair test_host_port_pairC(kTestHostC, 80); | 577 HostPortPair test_host_port_pairC(kTestHostC, 80); |
580 SpdySessionKey keyC( | 578 SpdySessionKey keyC( |
581 test_host_port_pairC, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); | 579 test_host_port_pairC, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); |
582 base::WeakPtr<SpdySession> sessionC = | 580 base::WeakPtr<SpdySession> sessionC = |
583 CreateInsecureSpdySession(http_session_, keyC, BoundNetLog()); | 581 CreateInsecureSpdySession(http_session_.get(), keyC, BoundNetLog()); |
584 | 582 |
585 sessionC->CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Error!"); | 583 sessionC->CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Error!"); |
586 EXPECT_TRUE(sessionC->IsDraining()); | 584 EXPECT_TRUE(sessionC->IsDraining()); |
587 | 585 |
588 spdy_session_pool_->OnIPAddressChanged(); | 586 spdy_session_pool_->OnIPAddressChanged(); |
589 | 587 |
590 #if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 588 #if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
591 EXPECT_TRUE(sessionA->IsGoingAway()); | 589 EXPECT_TRUE(sessionA->IsGoingAway()); |
592 EXPECT_TRUE(sessionB->IsDraining()); | 590 EXPECT_TRUE(sessionB->IsDraining()); |
593 EXPECT_TRUE(sessionC->IsDraining()); | 591 EXPECT_TRUE(sessionC->IsDraining()); |
(...skipping 19 matching lines...) Expand all Loading... |
613 EXPECT_TRUE(delegateA.StreamIsClosed()); | 611 EXPECT_TRUE(delegateA.StreamIsClosed()); |
614 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); | 612 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); |
615 EXPECT_TRUE(delegateB.StreamIsClosed()); | 613 EXPECT_TRUE(delegateB.StreamIsClosed()); |
616 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); | 614 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); |
617 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 615 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
618 } | 616 } |
619 | 617 |
620 } // namespace | 618 } // namespace |
621 | 619 |
622 } // namespace net | 620 } // namespace net |
OLD | NEW |