| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 test_host_port_pairA, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); | 545 test_host_port_pairA, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); |
| 546 base::WeakPtr<SpdySession> sessionA = | 546 base::WeakPtr<SpdySession> sessionA = |
| 547 CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog()); | 547 CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog()); |
| 548 | 548 |
| 549 GURL urlA(kTestHostA); | 549 GURL urlA(kTestHostA); |
| 550 base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously( | 550 base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously( |
| 551 SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog()); | 551 SPDY_BIDIRECTIONAL_STREAM, sessionA, urlA, MEDIUM, BoundNetLog()); |
| 552 test::StreamDelegateDoNothing delegateA(spdy_streamA); | 552 test::StreamDelegateDoNothing delegateA(spdy_streamA); |
| 553 spdy_streamA->SetDelegate(&delegateA); | 553 spdy_streamA->SetDelegate(&delegateA); |
| 554 | 554 |
| 555 std::unique_ptr<SpdyHeaderBlock> headers( | 555 SpdyHeaderBlock headers(spdy_util.ConstructGetHeaderBlock(urlA.spec())); |
| 556 new SpdyHeaderBlock(spdy_util.ConstructGetHeaderBlock(urlA.spec()))); | |
| 557 spdy_streamA->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND); | 556 spdy_streamA->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND); |
| 558 EXPECT_TRUE(spdy_streamA->HasUrlFromHeaders()); | 557 EXPECT_TRUE(spdy_streamA->HasUrlFromHeaders()); |
| 559 | 558 |
| 560 base::RunLoop().RunUntilIdle(); // Allow headers to write. | 559 base::RunLoop().RunUntilIdle(); // Allow headers to write. |
| 561 EXPECT_TRUE(delegateA.send_headers_completed()); | 560 EXPECT_TRUE(delegateA.send_headers_completed()); |
| 562 | 561 |
| 563 sessionA->MakeUnavailable(); | 562 sessionA->MakeUnavailable(); |
| 564 EXPECT_TRUE(sessionA->IsGoingAway()); | 563 EXPECT_TRUE(sessionA->IsGoingAway()); |
| 565 EXPECT_FALSE(delegateA.StreamIsClosed()); | 564 EXPECT_FALSE(delegateA.StreamIsClosed()); |
| 566 | 565 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 // there is no pushed stream on any sessions owned by |spdy_session_pool_|. | 660 // there is no pushed stream on any sessions owned by |spdy_session_pool_|. |
| 662 base::WeakPtr<SpdySession> session2 = | 661 base::WeakPtr<SpdySession> session2 = |
| 663 spdy_session_pool_->FindAvailableSession( | 662 spdy_session_pool_->FindAvailableSession( |
| 664 key, GURL("http://news.example.org/foo.html"), BoundNetLog()); | 663 key, GURL("http://news.example.org/foo.html"), BoundNetLog()); |
| 665 EXPECT_EQ(session.get(), session2.get()); | 664 EXPECT_EQ(session.get(), session2.get()); |
| 666 | 665 |
| 667 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); | 666 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); |
| 668 } | 667 } |
| 669 | 668 |
| 670 } // namespace net | 669 } // namespace net |
| OLD | NEW |