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> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "net/dns/host_cache.h" | 14 #include "net/dns/host_cache.h" |
15 #include "net/http/http_network_session.h" | 15 #include "net/http/http_network_session.h" |
16 #include "net/socket/client_socket_handle.h" | 16 #include "net/socket/client_socket_handle.h" |
17 #include "net/socket/transport_client_socket_pool.h" | 17 #include "net/socket/transport_client_socket_pool.h" |
18 #include "net/spdy/spdy_session.h" | 18 #include "net/spdy/spdy_session.h" |
19 #include "net/spdy/spdy_stream_test_util.h" | 19 #include "net/spdy/spdy_stream_test_util.h" |
20 #include "net/spdy/spdy_test_util_common.h" | 20 #include "net/spdy/spdy_test_util_common.h" |
21 #include "net/test/gtest_util.h" | 21 #include "net/test/gtest_util.h" |
22 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 | 24 |
25 using net::test::IsError; | 25 using net::test::IsError; |
26 using net::test::IsOk; | 26 using net::test::IsOk; |
27 | 27 |
28 namespace net { | 28 namespace net { |
29 | 29 |
30 class SpdySessionPoolTest : public ::testing::Test, | 30 class SpdySessionPoolTest : public ::testing::Test { |
31 public ::testing::WithParamInterface<NextProto> { | |
32 protected: | 31 protected: |
33 // Used by RunIPPoolingTest(). | 32 // Used by RunIPPoolingTest(). |
34 enum SpdyPoolCloseSessionsType { | 33 enum SpdyPoolCloseSessionsType { |
35 SPDY_POOL_CLOSE_SESSIONS_MANUALLY, | 34 SPDY_POOL_CLOSE_SESSIONS_MANUALLY, |
36 SPDY_POOL_CLOSE_CURRENT_SESSIONS, | 35 SPDY_POOL_CLOSE_CURRENT_SESSIONS, |
37 SPDY_POOL_CLOSE_IDLE_SESSIONS, | 36 SPDY_POOL_CLOSE_IDLE_SESSIONS, |
38 }; | 37 }; |
39 | 38 |
40 SpdySessionPoolTest() : spdy_session_pool_(NULL) {} | 39 SpdySessionPoolTest() : spdy_session_pool_(NULL) {} |
41 | 40 |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 // 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_|. |
663 base::WeakPtr<SpdySession> session2 = | 662 base::WeakPtr<SpdySession> session2 = |
664 spdy_session_pool_->FindAvailableSession( | 663 spdy_session_pool_->FindAvailableSession( |
665 key, GURL("http://news.example.org/foo.html"), BoundNetLog()); | 664 key, GURL("http://news.example.org/foo.html"), BoundNetLog()); |
666 EXPECT_EQ(session.get(), session2.get()); | 665 EXPECT_EQ(session.get(), session2.get()); |
667 | 666 |
668 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); | 667 spdy_session_pool_->CloseCurrentSessions(ERR_ABORTED); |
669 } | 668 } |
670 | 669 |
671 } // namespace net | 670 } // namespace net |
OLD | NEW |