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