| 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 // This isn't testing anything having to do with SPDY frames; we | 517 // This isn't testing anything having to do with SPDY frames; we |
| 518 // can ignore issues of how dependencies are set. We default to | 518 // can ignore issues of how dependencies are set. We default to |
| 519 // setting them (when doing the appropriate protocol) since that's | 519 // setting them (when doing the appropriate protocol) since that's |
| 520 // where we're eventually headed for all HTTP/2 connections. | 520 // where we're eventually headed for all HTTP/2 connections. |
| 521 session_deps_.enable_priority_dependencies = true; | 521 session_deps_.enable_priority_dependencies = true; |
| 522 SpdyTestUtil spdy_util(/*enable_priority_dependencies*/ true); | 522 SpdyTestUtil spdy_util(/*enable_priority_dependencies*/ true); |
| 523 | 523 |
| 524 MockRead reads[] = { | 524 MockRead reads[] = { |
| 525 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. | 525 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. |
| 526 }; | 526 }; |
| 527 std::unique_ptr<SpdySerializedFrame> req( | 527 SpdySerializedFrame req( |
| 528 spdy_util.ConstructSpdyGet("http://www.a.com", 1, MEDIUM)); | 528 spdy_util.ConstructSpdyGet("http://www.a.com", 1, MEDIUM)); |
| 529 MockWrite writes[] = {CreateMockWrite(*req, 1)}; | 529 MockWrite writes[] = {CreateMockWrite(req, 1)}; |
| 530 | 530 |
| 531 StaticSocketDataProvider dataA(reads, arraysize(reads), writes, | 531 StaticSocketDataProvider dataA(reads, arraysize(reads), writes, |
| 532 arraysize(writes)); | 532 arraysize(writes)); |
| 533 dataA.set_connect_data(connect_data); | 533 dataA.set_connect_data(connect_data); |
| 534 session_deps_.socket_factory->AddSocketDataProvider(&dataA); | 534 session_deps_.socket_factory->AddSocketDataProvider(&dataA); |
| 535 | 535 |
| 536 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); | 536 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); |
| 537 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); | 537 session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); |
| 538 | 538 |
| 539 CreateNetworkSession(); | 539 CreateNetworkSession(); |
| (...skipping 121 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_|. | 661 // there is no pushed stream on any sessions owned by |spdy_session_pool_|. |
| 662 base::WeakPtr<SpdySession> session2 = | 662 base::WeakPtr<SpdySession> session2 = |
| 663 spdy_session_pool_->FindAvailableSession( | 663 spdy_session_pool_->FindAvailableSession( |
| 664 key, GURL("http://news.example.org/foo.html"), BoundNetLog()); | 664 key, GURL("http://news.example.org/foo.html"), BoundNetLog()); |
| 665 EXPECT_EQ(session.get(), session2.get()); | 665 EXPECT_EQ(session.get(), session2.get()); |
| 666 | 666 |
| 667 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); | 667 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); |
| 668 } | 668 } |
| 669 | 669 |
| 670 } // namespace net | 670 } // namespace net |
| OLD | NEW |