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