| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_refptr<HttpNetworkSession> http_session_; |
| 48 SpdySessionPool* spdy_session_pool_; | 48 SpdySessionPool* spdy_session_pool_; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 INSTANTIATE_TEST_CASE_P( | 51 INSTANTIATE_TEST_CASE_P( |
| 52 NextProto, | 52 NextProto, |
| 53 SpdySessionPoolTest, | 53 SpdySessionPoolTest, |
| 54 testing::Values(kProtoDeprecatedSPDY2, | 54 testing::Values(kProtoSPDY31, kProtoSPDY4)); |
| 55 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4)); | |
| 56 | 55 |
| 57 // A delegate that opens a new session when it is closed. | 56 // A delegate that opens a new session when it is closed. |
| 58 class SessionOpeningDelegate : public SpdyStream::Delegate { | 57 class SessionOpeningDelegate : public SpdyStream::Delegate { |
| 59 public: | 58 public: |
| 60 SessionOpeningDelegate(SpdySessionPool* spdy_session_pool, | 59 SessionOpeningDelegate(SpdySessionPool* spdy_session_pool, |
| 61 const SpdySessionKey& key) | 60 const SpdySessionKey& key) |
| 62 : spdy_session_pool_(spdy_session_pool), | 61 : spdy_session_pool_(spdy_session_pool), |
| 63 key_(key) {} | 62 key_(key) {} |
| 64 | 63 |
| 65 ~SessionOpeningDelegate() override {} | 64 ~SessionOpeningDelegate() override {} |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 EXPECT_TRUE(delegateA.StreamIsClosed()); | 610 EXPECT_TRUE(delegateA.StreamIsClosed()); |
| 612 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); | 611 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateA.WaitForClose()); |
| 613 EXPECT_TRUE(delegateB.StreamIsClosed()); | 612 EXPECT_TRUE(delegateB.StreamIsClosed()); |
| 614 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); | 613 EXPECT_EQ(ERR_NETWORK_CHANGED, delegateB.WaitForClose()); |
| 615 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 614 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
| 616 } | 615 } |
| 617 | 616 |
| 618 } // namespace | 617 } // namespace |
| 619 | 618 |
| 620 } // namespace net | 619 } // namespace net |
| OLD | NEW |